[Tests] Fix code for isort 4.0.0

This commit is contained in:
bendikro 2015-07-16 00:09:49 +02:00 committed by Calum Lind
parent 379ba33bb9
commit 9d662bf059
31 changed files with 44 additions and 14 deletions

View File

@ -1,4 +1,5 @@
"""Deluge""" """Deluge"""
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -17,10 +17,11 @@ import gtk
import gtk.glade import gtk.glade
import deluge.component as component import deluge.component as component
from .common import get_resource
from deluge.plugins.pluginbase import GtkPluginBase from deluge.plugins.pluginbase import GtkPluginBase
from deluge.ui.client import client from deluge.ui.client import client
from .common import get_resource
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -8,12 +8,11 @@
# #
import logging import logging
from deluge import component # for systray from deluge import component # for systray
from deluge.plugins.pluginbase import GtkPluginBase from deluge.plugins.pluginbase import GtkPluginBase
from . import sidebar_menu from . import label_config, sidebar_menu, submenu
from . import label_config
from . import submenu
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -1,3 +1,4 @@
# this is a namespace package # this is a namespace package
import pkg_resources import pkg_resources
pkg_resources.declare_namespace(__name__) pkg_resources.declare_namespace(__name__)

View File

@ -4,12 +4,13 @@ import warnings
from twisted.trial import unittest from twisted.trial import unittest
import common
from deluge import component from deluge import component
from deluge.core.core import Core from deluge.core.core import Core
from deluge.core.rpcserver import RPCServer from deluge.core.rpcserver import RPCServer
from deluge.error import InvalidTorrentError from deluge.error import InvalidTorrentError
from . import common
warnings.filterwarnings("ignore", category=RuntimeWarning) warnings.filterwarnings("ignore", category=RuntimeWarning)
warnings.resetwarnings() warnings.resetwarnings()

View File

@ -9,4 +9,5 @@
UI_PATH = __path__[0] UI_PATH = __path__[0]
from deluge.ui.console.main import start from deluge.ui.console.main import start
assert start # silence pyflakes assert start # silence pyflakes

View File

@ -1,2 +1,3 @@
from deluge.ui.gtkui.gtkui import start from deluge.ui.gtkui.gtkui import start
assert start # silence pyflakes assert start # silence pyflakes

View File

@ -6,6 +6,8 @@
# the additional special exception to link portions of this program with the OpenSSL library. # the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details. # See LICENSE for more details.
# #
# We skip isorting this file as it want to move the gtk2reactor.install() below the imports
# isort:skip_file
import logging import logging
import os import os
@ -18,7 +20,8 @@ from twisted.internet import gtk2reactor
from twisted.internet.error import ReactorAlreadyInstalledError from twisted.internet.error import ReactorAlreadyInstalledError
try: try:
reactor = gtk2reactor.install() # Install twisted reactor, before any other modules import reactor. # Install twisted reactor, before any other modules import reactor.
reactor = gtk2reactor.install()
except ReactorAlreadyInstalledError: except ReactorAlreadyInstalledError:
# Running unit tests so trial already installed a rector # Running unit tests so trial already installed a rector
pass pass

View File

@ -1,2 +1,3 @@
from deluge.ui.web.web import start from deluge.ui.web.web import start
assert start # silence pyflakes assert start # silence pyflakes

View File

@ -15,8 +15,10 @@ includes = glib, gio, cairo, pango, pangocairo, atk, gobject, gtk.keysyms,
frameworks = CoreFoundation, Foundation, AppKit frameworks = CoreFoundation, Foundation, AppKit
[isort] [isort]
default_section=THIRDPARTY
known_standard_library=unicodedata known_standard_library=unicodedata
line_length=120 known_third_party=pygtk,gtk,gobject,gtk.gdk,pango,cairo,pangocairo,twisted,pytest,OpenSSL,pkg_resources,chardet
skip=gtkui.py known_first_party=msgfmt,
known_third_party=pygtk,gtk,gobject,gtk.gdk,pango,cairo,pangocairo,twisted
order_by_type=true order_by_type=true
line_length=120
not_skip=__init__.py

View File

@ -200,9 +200,10 @@ class CleanPlugins(cmd.Command):
for path in glob.glob(plugin_path): for path in glob.glob(plugin_path):
if os.path.exists(os.path.join(path, "setup.py")): if os.path.exists(os.path.join(path, "setup.py")):
c = "cd " + path + "&& " + sys.executable + " setup.py clean" c = "cd " + path + " && " + sys.executable + " setup.py clean"
if self.all: if self.all:
c += " -a" c += " -a"
print("Calling '%s'" % c)
os.system(c) os.system(c)
# Delete the .eggs # Delete the .eggs

View File

@ -78,7 +78,7 @@ commands = {[testenv:pydef]commands}
[testenv:isort] [testenv:isort]
deps = deps =
{[testenv]deps} {[testenv]deps}
isort isort>=4.0.0
whitelist_externals = whitelist_externals =
{[testenv]whitelist_externals} {[testenv]whitelist_externals}
isort isort

View File

@ -3,13 +3,13 @@ import os
import shutil import shutil
import sys import sys
import gtk
import bbfreeze.recipes import bbfreeze.recipes
import deluge.common import gtk
import icon import icon
from bbfreeze import Freezer from bbfreeze import Freezer
import deluge.common
# Get build_version from installed deluge # Get build_version from installed deluge
build_version = deluge.common.get_version() build_version = deluge.common.get_version()
print "Deluge Version: %s" % build_version print "Deluge Version: %s" % build_version