Skip to content

Commit

Permalink
Code cosmetics
Browse files Browse the repository at this point in the history
autopep8 + isort
  • Loading branch information
vuolter committed Feb 16, 2017
1 parent 4c64cd6 commit 6ed9d7b
Show file tree
Hide file tree
Showing 170 changed files with 957 additions and 964 deletions.
10 changes: 6 additions & 4 deletions locale/pavement.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import division, print_function, unicode_literals
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from future import standard_library
standard_library.install_aliases()
import fnmatch
import io
import os
Expand All @@ -15,9 +13,13 @@
from subprocess import Popen, call
from tempfile import mkdtemp

from future import standard_library

from paver.easy import *
from pyload import info

standard_library.install_aliases()


# patch to let it support list of patterns

Expand Down
12 changes: 7 additions & 5 deletions pyLoad.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,25 @@
# \ /
# \/

from __future__ import print_function, unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from future import standard_library
standard_library.install_aliases()
import argparse
# from multiprocessing import freeze_support
import operator
import os
import sys
from builtins import PACKDIR, map

from future import standard_library

import pyload
from pyload.utils import format
from pyload.utils.sys import set_console_icon, set_console_title

standard_library.install_aliases()


try:
import colorama
except ImportError:
Expand Down
9 changes: 3 additions & 6 deletions pyload/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@
# \ /
# \/

from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from builtins import int
import builtins
import codecs
import os
import tempfile
from builtins import int

import daemonize
import psutil
Expand Down Expand Up @@ -52,7 +50,6 @@
sys.path.append(PACKDIR)
sys.path.append(USERDIR)

# import codecs
# codecs.register(lambda name: codecs.lookup('utf-8') if name == 'cp65001' else None)
writer = codecs.getwriter(sys.console_encoding(sys.stdout.encoding))
sys.stdout = writer(sys.stdout, errors="replace")
Expand Down
22 changes: 11 additions & 11 deletions pyload/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# -*- coding: utf-8 -*-
#@author: RaNaN

from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import object
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import re
from types import MethodType
from builtins import object, str

from future import standard_library

from pyload.datatype import User
from pyload.remote.apitypes import *
from types import MethodType

standard_library.install_aliases()


# contains function names mapped to their permissions
# unlisted functions are for admins only
Expand Down Expand Up @@ -48,8 +50,6 @@ def __new__(cls, func, *args, **kwargs):
def state_string(state):
return ",".join(str(x) for x in state_map[state])

from pyload.datatype import User


class Api(Iface):
"""
Expand Down
9 changes: 5 additions & 4 deletions pyload/api/account.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import, unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from future import standard_library
standard_library.install_aliases()

from pyload.api import Api, Permission, require_perm
from pyload.api.base import BaseApi
from pyload.utils.convert import to_bool

standard_library.install_aliases()


class AccountApi(BaseApi):
"""
Expand Down
9 changes: 5 additions & 4 deletions pyload/api/addon.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import, unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from future import standard_library
standard_library.install_aliases()

from pyload.api import Api, Permission, require_perm
from pyload.api.base import BaseApi

standard_library.install_aliases()


# TODO: multi user
class AddonApi(BaseApi):
Expand Down
10 changes: 5 additions & 5 deletions pyload/api/base.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from future import standard_library
standard_library.install_aliases()

from pyload.remote.apitypes import Iface

standard_library.install_aliases()

# Workaround to let code-completion think, this is subclass of Iface
Iface = object

Expand Down
9 changes: 5 additions & 4 deletions pyload/api/config.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import, unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from future import standard_library
standard_library.install_aliases()

from pyload.api import (Api, ConfigHolder, ConfigInfo, ConfigItem, Permission,
require_perm)
from pyload.api.base import BaseApi
from pyload.utils.convert import to_str

standard_library.install_aliases()


# helper function to create a ConfigHolder

Expand Down
11 changes: 6 additions & 5 deletions pyload/api/core.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import, unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from future import standard_library
standard_library.install_aliases()
import io
import os

from future import standard_library

from pyload.api import Api, Interaction, Permission, StatusInfo, require_perm
from pyload.api.base import BaseApi

standard_library.install_aliases()


class CoreApi(BaseApi):
"""
Expand Down
11 changes: 6 additions & 5 deletions pyload/api/download.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import, unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from future import standard_library
standard_library.install_aliases()
import io
import os
from builtins import str

from future import standard_library

from pyload.api import Api, Permission, Role, require_perm
from pyload.api.base import BaseApi

standard_library.install_aliases()


class DownloadApi(BaseApi):
"""
Expand Down
9 changes: 5 additions & 4 deletions pyload/api/file.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import, unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from future import standard_library
standard_library.install_aliases()

from pyload.api import PackageStatus as PS
from pyload.api import (Api, DownloadState, FileDoesNotExist,
PackageDoesNotExist, Permission, require_perm)
from pyload.api.base import BaseApi
from pyload.utils.purge import uniqify

standard_library.install_aliases()


# TODO: user context
class FileApi(BaseApi):
Expand Down
9 changes: 5 additions & 4 deletions pyload/api/interaction.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import, unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from future import standard_library
standard_library.install_aliases()

from pyload.api import Api, Interaction, Permission, require_perm
from pyload.api.base import BaseApi

standard_library.install_aliases()


class UserInteractionApi(BaseApi):
"""
Expand Down
11 changes: 6 additions & 5 deletions pyload/api/predownload.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import, unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from future import standard_library
standard_library.install_aliases()
import io
import os
from builtins import str
from itertools import chain

from future import standard_library

from pyload.api import DownloadStatus as DS
from pyload.api import (Api, LinkStatus, OnlineCheck, Permission, require_perm,
urlmatcher)
Expand All @@ -19,6 +18,8 @@
from pyload.utils.packagetools import parse_names
from pyload.utils.purge import uniqify

standard_library.install_aliases()


class PreDownloadApi(BaseApi):
"""
Expand Down
9 changes: 5 additions & 4 deletions pyload/api/stat.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import, unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from future import standard_library
standard_library.install_aliases()

from pyload.api import Api
from pyload.api.base import BaseApi

standard_library.install_aliases()

CACHE = {}
QUOTA_UNLIMITED = -1

Expand Down
9 changes: 5 additions & 4 deletions pyload/api/user.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import, unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from future import standard_library
standard_library.install_aliases()

from pyload.api import Api, Permission, require_perm
from pyload.api.base import BaseApi

standard_library.install_aliases()


class UserApi(BaseApi):
"""
Expand Down
13 changes: 7 additions & 6 deletions pyload/config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from future import standard_library
standard_library.install_aliases()

from pyload.config import Config
from pyload.config.parser import Section
from pyload.config.default import make_config
from pyload.config.parser import Section

standard_library.install_aliases()
Loading

0 comments on commit 6ed9d7b

Please sign in to comment.