Skip to content

Commit

Permalink
[Tests] Fix code for isort 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bendikro authored and cas-- committed Aug 14, 2015
1 parent 379ba33 commit 9d662bf
Show file tree
Hide file tree
Showing 31 changed files with 44 additions and 14 deletions.
1 change: 1 addition & 0 deletions deluge/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Deluge"""
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/AutoAdd/deluge/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/AutoAdd/deluge/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/Execute/deluge/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/Execute/deluge/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/Extractor/deluge/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/Extractor/deluge/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
3 changes: 2 additions & 1 deletion deluge/plugins/Extractor/deluge/plugins/extractor/gtkui.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
import gtk.glade

import deluge.component as component
from .common import get_resource
from deluge.plugins.pluginbase import GtkPluginBase
from deluge.ui.client import client

from .common import get_resource

log = logging.getLogger(__name__)


Expand Down
1 change: 1 addition & 0 deletions deluge/plugins/Label/deluge/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/Label/deluge/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
5 changes: 2 additions & 3 deletions deluge/plugins/Label/deluge/plugins/label/gtkui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
#

import logging

from deluge import component # for systray
from deluge.plugins.pluginbase import GtkPluginBase

from . import sidebar_menu
from . import label_config
from . import submenu
from . import label_config, sidebar_menu, submenu

log = logging.getLogger(__name__)

Expand Down
1 change: 1 addition & 0 deletions deluge/plugins/Notifications/deluge/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/Notifications/deluge/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/Scheduler/deluge/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/Scheduler/deluge/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/Stats/deluge/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/Stats/deluge/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/Toggle/deluge/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/Toggle/deluge/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/WebUi/deluge/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/WebUi/deluge/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions deluge/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# this is a namespace package
import pkg_resources

pkg_resources.declare_namespace(__name__)
3 changes: 2 additions & 1 deletion deluge/tests/test_torrentmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

from twisted.trial import unittest

import common
from deluge import component
from deluge.core.core import Core
from deluge.core.rpcserver import RPCServer
from deluge.error import InvalidTorrentError

from . import common

warnings.filterwarnings("ignore", category=RuntimeWarning)
warnings.resetwarnings()

Expand Down
1 change: 1 addition & 0 deletions deluge/ui/console/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@

UI_PATH = __path__[0]
from deluge.ui.console.main import start

assert start # silence pyflakes
1 change: 1 addition & 0 deletions deluge/ui/gtkui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from deluge.ui.gtkui.gtkui import start

assert start # silence pyflakes
5 changes: 4 additions & 1 deletion deluge/ui/gtkui/gtkui.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# the additional special exception to link portions of this program with the OpenSSL library.
# 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 os
Expand All @@ -18,7 +20,8 @@
from twisted.internet.error import ReactorAlreadyInstalledError

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:
# Running unit tests so trial already installed a rector
pass
Expand Down
1 change: 1 addition & 0 deletions deluge/ui/web/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from deluge.ui.web.web import start

assert start # silence pyflakes
8 changes: 5 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ includes = glib, gio, cairo, pango, pangocairo, atk, gobject, gtk.keysyms,
frameworks = CoreFoundation, Foundation, AppKit

[isort]
default_section=THIRDPARTY
known_standard_library=unicodedata
line_length=120
skip=gtkui.py
known_third_party=pygtk,gtk,gobject,gtk.gdk,pango,cairo,pangocairo,twisted
known_third_party=pygtk,gtk,gobject,gtk.gdk,pango,cairo,pangocairo,twisted,pytest,OpenSSL,pkg_resources,chardet
known_first_party=msgfmt,
order_by_type=true
line_length=120
not_skip=__init__.py
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,10 @@ def run(self):

for path in glob.glob(plugin_path):
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:
c += " -a"
print("Calling '%s'" % c)
os.system(c)

# Delete the .eggs
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ commands = {[testenv:pydef]commands}
[testenv:isort]
deps =
{[testenv]deps}
isort
isort>=4.0.0
whitelist_externals =
{[testenv]whitelist_externals}
isort
Expand Down
6 changes: 3 additions & 3 deletions win32/deluge-bbfreeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import shutil
import sys

import gtk

import bbfreeze.recipes
import deluge.common
import gtk
import icon
from bbfreeze import Freezer

import deluge.common

# Get build_version from installed deluge
build_version = deluge.common.get_version()
print "Deluge Version: %s" % build_version
Expand Down

0 comments on commit 9d662bf

Please sign in to comment.