From 52d591c83b91e47819f41828d73ae80b52341f88 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Thu, 10 Nov 2016 10:55:04 +0000 Subject: [PATCH] [GTKUI] Remove unneeded pygtk requires check --- deluge/ui/gtkui/aboutdialog.py | 3 --- deluge/ui/gtkui/addtorrentdialog.py | 3 --- deluge/ui/gtkui/common.py | 4 ---- deluge/ui/gtkui/gtkui.py | 4 ++++ deluge/ui/gtkui/listview.py | 4 ---- deluge/ui/gtkui/mainwindow.py | 5 ----- deluge/ui/gtkui/menubar.py | 4 ---- deluge/ui/gtkui/preferences.py | 4 ---- deluge/ui/gtkui/toolbar.py | 4 ---- deluge/ui/gtkui/torrentview.py | 3 --- 10 files changed, 4 insertions(+), 34 deletions(-) diff --git a/deluge/ui/gtkui/aboutdialog.py b/deluge/ui/gtkui/aboutdialog.py index 288162ba3..9bfe633ff 100644 --- a/deluge/ui/gtkui/aboutdialog.py +++ b/deluge/ui/gtkui/aboutdialog.py @@ -8,14 +8,11 @@ # import gtk -import pygtk from deluge.common import get_pixmap, get_version, open_url_in_browser from deluge.ui.client import client from deluge.ui.gtkui.common import get_deluge_icon -pygtk.require('2.0') - class AboutDialog(object): def __init__(self): diff --git a/deluge/ui/gtkui/addtorrentdialog.py b/deluge/ui/gtkui/addtorrentdialog.py index 8227fa913..799991748 100644 --- a/deluge/ui/gtkui/addtorrentdialog.py +++ b/deluge/ui/gtkui/addtorrentdialog.py @@ -16,7 +16,6 @@ from xml.sax.saxutils import escape as xml_escape import gobject import gtk -import pygtk import deluge.common import deluge.component as component @@ -29,8 +28,6 @@ from deluge.ui.gtkui.dialogs import ErrorDialog from deluge.ui.gtkui.path_chooser import PathChooser from deluge.ui.gtkui.torrentview_data_funcs import cell_data_size -pygtk.require('2.0') - log = logging.getLogger(__name__) diff --git a/deluge/ui/gtkui/common.py b/deluge/ui/gtkui/common.py index 152a06c3e..45a32ff63 100644 --- a/deluge/ui/gtkui/common.py +++ b/deluge/ui/gtkui/common.py @@ -16,14 +16,10 @@ import shutil import sys import gtk -import pygtk from gobject import GError import deluge.common -pygtk.require('2.0') - - log = logging.getLogger(__name__) diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index 8834a5ee3..72094e06b 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -15,6 +15,10 @@ import signal import sys import time +import pygtk # isort:skip (Required before gtk import). +pygtk.require('2.0') # NOQA: E402 + +# isort:imports-thirdparty import gobject import gtk from twisted.internet import defer, gtk2reactor diff --git a/deluge/ui/gtkui/listview.py b/deluge/ui/gtkui/listview.py index 81dd28e64..e639c21bb 100644 --- a/deluge/ui/gtkui/listview.py +++ b/deluge/ui/gtkui/listview.py @@ -10,14 +10,10 @@ import logging import gtk -import pygtk from gobject import SIGNAL_RUN_LAST, TYPE_NONE, signal_new from deluge.ui.gtkui.common import load_pickled_state_file, save_pickled_state_file -pygtk.require('2.0') - - signal_new('button-press-event', gtk.TreeViewColumn, SIGNAL_RUN_LAST, TYPE_NONE, (gtk.gdk.Event,)) log = logging.getLogger(__name__) diff --git a/deluge/ui/gtkui/mainwindow.py b/deluge/ui/gtkui/mainwindow.py index d40b9e01e..e7ef3d951 100644 --- a/deluge/ui/gtkui/mainwindow.py +++ b/deluge/ui/gtkui/mainwindow.py @@ -13,7 +13,6 @@ import os.path from hashlib import sha1 as sha import gtk -import pygtk from twisted.internet import reactor from twisted.internet.error import ReactorNotRunning @@ -25,15 +24,11 @@ from deluge.ui.client import client from deluge.ui.gtkui.dialogs import PasswordDialog from deluge.ui.gtkui.ipcinterface import process_args -pygtk.require('2.0') - - try: import wnck except ImportError: wnck = None - log = logging.getLogger(__name__) diff --git a/deluge/ui/gtkui/menubar.py b/deluge/ui/gtkui/menubar.py index 2c50eac46..62053db44 100644 --- a/deluge/ui/gtkui/menubar.py +++ b/deluge/ui/gtkui/menubar.py @@ -13,7 +13,6 @@ import logging import os.path import gtk -import pygtk import deluge.common import deluge.component as component @@ -22,9 +21,6 @@ from deluge.ui.client import client from deluge.ui.gtkui.dialogs import ErrorDialog, OtherDialog from deluge.ui.gtkui.path_chooser import PathChooser -pygtk.require('2.0') - - log = logging.getLogger(__name__) diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 10d1c4175..4ec078d06 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -13,7 +13,6 @@ import os from hashlib import sha1 as sha import gtk -import pygtk import deluge.common import deluge.component as component @@ -30,9 +29,6 @@ try: except ImportError: appindicator = False -pygtk.require('2.0') - - log = logging.getLogger(__name__) ACCOUNTS_USERNAME, ACCOUNTS_LEVEL, ACCOUNTS_PASSWORD = range(3) diff --git a/deluge/ui/gtkui/toolbar.py b/deluge/ui/gtkui/toolbar.py index ffde58ec4..a8024ca08 100644 --- a/deluge/ui/gtkui/toolbar.py +++ b/deluge/ui/gtkui/toolbar.py @@ -10,14 +10,10 @@ import logging import gtk -import pygtk import deluge.component as component from deluge.configmanager import ConfigManager -pygtk.require('2.0') - - log = logging.getLogger(__name__) diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py index 2b0afd6a2..df3efcd74 100644 --- a/deluge/ui/gtkui/torrentview.py +++ b/deluge/ui/gtkui/torrentview.py @@ -14,7 +14,6 @@ from locale import strcoll import gobject import gtk -import pygtk from twisted.internet import reactor import deluge.component as component @@ -23,8 +22,6 @@ from deluge.ui.gtkui import torrentview_data_funcs as funcs from deluge.ui.gtkui.listview import ListView from deluge.ui.gtkui.removetorrentdialog import RemoveTorrentDialog -pygtk.require('2.0') - log = logging.getLogger(__name__)