diff --git a/deluge/common.py b/deluge/common.py index c3270b14f..7246cd3fe 100644 --- a/deluge/common.py +++ b/deluge/common.py @@ -40,7 +40,6 @@ import os import time import subprocess import platform -import sys import chardet import logging diff --git a/deluge/core/core.py b/deluge/core/core.py index 6d4c13793..983bfa75c 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -38,18 +38,10 @@ from deluge._libtorrent import lt import os import glob import base64 -import shutil import logging import threading -import pkg_resources -import warnings import tempfile - -from twisted.internet import reactor, defer -from twisted.internet.task import LoopingCall -import twisted.web.client - from deluge.httpdownloader import download_file import deluge.configmanager diff --git a/deluge/core/pluginmanager.py b/deluge/core/pluginmanager.py index 119928979..5ef5ef55f 100644 --- a/deluge/core/pluginmanager.py +++ b/deluge/core/pluginmanager.py @@ -37,8 +37,6 @@ """PluginManager for Core""" import logging -from twisted.internet import reactor -from twisted.internet.task import LoopingCall from deluge.event import PluginEnabledEvent, PluginDisabledEvent import deluge.pluginmanagerbase diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py index a79659866..bc108c007 100644 --- a/deluge/core/preferencesmanager.py +++ b/deluge/core/preferencesmanager.py @@ -38,7 +38,6 @@ import os import logging import threading import pkg_resources -from twisted.internet import reactor from twisted.internet.task import LoopingCall from deluge._libtorrent import lt diff --git a/deluge/core/rpcserver.py b/deluge/core/rpcserver.py index ef2e3342f..e309f7bda 100644 --- a/deluge/core/rpcserver.py +++ b/deluge/core/rpcserver.py @@ -43,7 +43,7 @@ import logging import traceback from twisted.internet.protocol import Factory, Protocol -from twisted.internet import ssl, reactor, defer +from twisted.internet import reactor, defer from OpenSSL import crypto, SSL from types import FunctionType diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 4c57874fc..269fe0213 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -44,7 +44,6 @@ import operator import logging import re -from twisted.internet import reactor from twisted.internet.task import LoopingCall from deluge._libtorrent import lt @@ -569,7 +568,7 @@ class TorrentManager(component.Component): # Remove the torrent from deluge's session try: del self.torrents[torrent_id] - except KeyError, ValueError: + except (KeyError, ValueError): return False # Save the session state diff --git a/deluge/maketorrent.py b/deluge/maketorrent.py index 585dcaa4e..196399df7 100644 --- a/deluge/maketorrent.py +++ b/deluge/maketorrent.py @@ -38,7 +38,7 @@ import os from hashlib import sha1 as sha from deluge.common import get_path_size -from deluge.bencode import bencode, bdecode +from deluge.bencode import bencode class InvalidPath(Exception): """ diff --git a/deluge/rencode.py b/deluge/rencode.py index 2b32c001b..1172df2e5 100644 --- a/deluge/rencode.py +++ b/deluge/rencode.py @@ -63,7 +63,6 @@ __all__ = ['dumps', 'loads'] # import struct -import string from threading import Lock # Default number of bits for serialized floats, either 32 or 64 (also a parameter for dumps()). diff --git a/deluge/ui/gtkui/connectionmanager.py b/deluge/ui/gtkui/connectionmanager.py index 9ce16ac3c..2ea302e76 100644 --- a/deluge/ui/gtkui/connectionmanager.py +++ b/deluge/ui/gtkui/connectionmanager.py @@ -35,7 +35,6 @@ import gtk import pkg_resources -import urlparse import time import hashlib import logging diff --git a/deluge/ui/gtkui/mainwindow.py b/deluge/ui/gtkui/mainwindow.py index 12fa5a96d..a3265d813 100644 --- a/deluge/ui/gtkui/mainwindow.py +++ b/deluge/ui/gtkui/mainwindow.py @@ -38,7 +38,6 @@ import pygtk pygtk.require('2.0') import gtk import gtk.glade -import gobject import logging import pkg_resources from urlparse import urlparse diff --git a/deluge/ui/gtkui/peers_tab.py b/deluge/ui/gtkui/peers_tab.py index 20cdfbfad..b4a39ce55 100644 --- a/deluge/ui/gtkui/peers_tab.py +++ b/deluge/ui/gtkui/peers_tab.py @@ -40,7 +40,6 @@ import logging import os.path import cPickle import pkg_resources -import gobject from itertools import izip from deluge.ui.client import client diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py index 659010f05..46d9dbcc3 100644 --- a/deluge/ui/gtkui/torrentview.py +++ b/deluge/ui/gtkui/torrentview.py @@ -477,7 +477,7 @@ class TorrentView(listview.ListView, component.Component): return [] return torrent_ids - except ValueError, TypeError: + except (ValueError, TypeError): return [] def get_torrent_status(self, torrent_id):