Remove unused imports.

This commit is contained in:
Emmanuel Gil Peyrot 2017-02-07 19:56:26 +00:00
parent 07716daec2
commit 289d82fae7
32 changed files with 12 additions and 64 deletions

View File

@ -29,7 +29,6 @@ from gi.repository import GLib
from gi.repository import Pango
from common import gajim
from common import helpers
(
OPT_TYPE,

View File

@ -22,7 +22,6 @@
##
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GLib

View File

@ -19,7 +19,6 @@ architecture to implement commands in a streight and flexible,
declarative way.
"""
import re
from types import FunctionType
from inspect import getargspec, getdoc

View File

@ -31,7 +31,6 @@ from ..framework import CommandContainer, command, doc
from ..mapping import generate_usage
from .hosts import ChatCommands, PrivateChatCommands, GroupChatCommands
from . import execute
# This holds constants fron the logger, which we'll be using in some of our
# commands.

View File

@ -24,8 +24,6 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from types import *
def remove(sequence, target):
if isinstance(sequence, list):
if target in sequence:

View File

@ -30,14 +30,13 @@
import os
import base64
import sys
import operator
import hashlib
from gi.repository import GLib
from time import (altzone, daylight, gmtime, localtime, mktime, strftime,
from time import (altzone, daylight, gmtime, localtime, strftime,
time as time_time, timezone, tzname)
from calendar import timegm
from gi.repository import GLib
import nbxmpp
from common import caps_cache as capscache
@ -63,11 +62,6 @@ from common.nec import NetworkEvent
from common.jingle import ConnectionJingle
from common import dbus_support
if dbus_support.supported:
import dbus
from music_track_listener import MusicTrackListener
import logging
log = logging.getLogger('gajim.c.connection_handlers')
@ -603,7 +597,7 @@ class ConnectionVcard:
node = conf.getAttr('node')
form_tag = conf.getTag('x', namespace=nbxmpp.NS_DATA)
if form_tag:
form = common.dataforms.ExtendForm(node=form_tag)
form = dataforms.ExtendForm(node=form_tag)
gajim.nec.push_incoming_event(PEPConfigReceivedEvent(None,
conn=self, node=node, form=form))

View File

@ -21,7 +21,7 @@
import datetime
import sys
import os
from time import (localtime, time as time_time)
from time import time as time_time
from calendar import timegm
import hmac
import hashlib

View File

@ -35,7 +35,6 @@ import uuid
from common import config
import nbxmpp
from common import defs
from common import ged as ged_module
interface = None # The actual interface (the gtk one for the moment)

View File

@ -45,7 +45,6 @@ import socket
import time
import datetime
from gi.repository import GObject
from encodings.punycode import punycode_encode
from string import Template

View File

@ -20,7 +20,6 @@ Handles Jingle contents (XEP 0166)
import os
from common import gajim
import nbxmpp
from common.jingle_transport import JingleTransportIBB
from .jingle_xtls import SELF_SIGNED_CERTIFICATE
from .jingle_xtls import load_cert_file

View File

@ -28,7 +28,6 @@ from . import jingle_xtls
from common.jingle_content import contents, JingleContent
from common.jingle_transport import *
from common import helpers
from common.socks5 import Socks5ReceiverClient, Socks5SenderClient
from common.connection_handlers_events import FileRequestReceivedEvent
import threading
import logging

View File

@ -20,7 +20,6 @@ Handles Jingle Transports (currently only ICE-UDP)
import nbxmpp
import socket
from common import gajim
from common.protocol.bytestream import ConnectionSocks5Bytestream
import logging
log = logging.getLogger('gajim.c.jingle_transport')

View File

@ -44,9 +44,7 @@ except ImportError:
log.info("PyOpenSSL not available")
if PYOPENSSL_PRESENT:
from OpenSSL import SSL
from OpenSSL.SSL import Context
from OpenSSL import crypto
from OpenSSL import SSL, crypto
TYPE_RSA = crypto.TYPE_RSA
TYPE_DSA = crypto.TYPE_DSA

View File

@ -21,7 +21,6 @@
from datetime import datetime
from common import gajim
from common import pep
from common import dbus_support
if dbus_support.supported:
import dbus

View File

@ -216,13 +216,10 @@ LOCATION_DATA = {
'uri': _('uri')}
from gi.repository import GLib
from gi.repository import Gtk
from gi.repository import GdkPixbuf
import logging
log = logging.getLogger('gajim.c.pep')
from common import helpers
import nbxmpp
from common import gajim

View File

@ -36,7 +36,6 @@ import time
import nbxmpp
from common import gajim
from common import helpers
from common import dataforms
from common import ged
from common import jingle_xtls
from common.file_props import FilesProp

View File

@ -27,7 +27,6 @@ log = logging.getLogger('gajim.c.p.caps')
from common import gajim
from common import ged
from common import helpers
from common.connection_handlers_events import CapsPresenceReceivedEvent, \
CapsDiscoReceivedEvent, CapsReceivedEvent

View File

@ -22,7 +22,6 @@ import nbxmpp
from nbxmpp.idlequeue import IdleObject
from nbxmpp import dispatcher_nb, simplexml
from nbxmpp.plugin import *
from nbxmpp.simplexml import ustr
from nbxmpp.transports_nb import DATA_RECEIVED, DATA_SENT, DATA_ERROR
from common.zeroconf import zeroconf

View File

@ -23,13 +23,9 @@
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
##
import time
import nbxmpp
from common import helpers
from common import gajim
from common.zeroconf import zeroconf
from common.commands import ConnectionCommands
from common.protocol.bytestream import ConnectionSocks5BytestreamZeroconf
from common.connection_handlers_events import ZeroconfMessageReceivedEvent
@ -51,7 +47,6 @@ except Exception:
HAS_IDLE = False
from common import connection_handlers
from session import ChatControlSession
class ConnectionVcard(connection_handlers.ConnectionVcard):
def add_sha(self, p, send_caps = True):

View File

@ -50,8 +50,6 @@ from common.zeroconf import zeroconf
from common.zeroconf.connection_handlers_zeroconf import *
from common.connection_handlers_events import *
import locale
class ConnectionZeroconf(CommonConnection, ConnectionHandlersZeroconf):
def __init__(self, name):
ConnectionHandlersZeroconf.__init__(self)

View File

@ -26,7 +26,7 @@ except ImportError:
pass
from common.zeroconf.zeroconf import C_BARE_NAME, C_RESOLVED_INFO, \
C_RI_INTERFACE, C_RI_PROTOCOL, C_RI_APROTOCOL, C_DOMAIN, C_TXT
C_RI_INTERFACE, C_RI_PROTOCOL, C_DOMAIN, C_TXT
class Zeroconf:
def __init__(self, new_serviceCB, remove_serviceCB, name_conflictCB,

View File

@ -51,7 +51,6 @@ from common.fuzzyclock import FuzzyClock
from htmltextview import HtmlTextView
from common.exceptions import GajimGeneralException
from encodings.punycode import punycode_encode as puny_encode
NOT_SHOWN = 0
ALREADY_RECEIVED = 1

View File

@ -29,7 +29,6 @@ from gi.repository import Gtk
import gtkgui_helpers
from common import gajim
from common import helpers
from common.i18n import Q_
class FeaturesWindow:

View File

@ -55,7 +55,6 @@ from common import i18n
from chat_control import ChatControl
from chat_control_base import ChatControlBase
from common.exceptions import GajimGeneralException
from command_system.implementation.hosts import PrivateChatCommands
from command_system.implementation.hosts import GroupChatCommands

View File

@ -80,13 +80,11 @@ from common import caps_cache
from common import proxy65_manager
from common import socks5
from common import helpers
from common import dataforms
from common import passwords
from common import logging_helpers
from common.connection_handlers_events import OurShowEvent, \
FileRequestErrorEvent, FileTransferCompletedEvent, InformationEvent
FileRequestErrorEvent, FileTransferCompletedEvent
from common.connection import Connection
from common import jingle
from common.file_props import FilesProp
from common import pep

View File

@ -89,7 +89,6 @@ del parseOpts
import common.configpaths
common.configpaths.gajimpaths.init(config_path)
del config_path
from common import exceptions
from common import gajim
import gtkgui_helpers
from common.logger import LOG_DB_PATH, constants

View File

@ -51,7 +51,6 @@ if __name__ == '__main__':
from common import i18n
import common.configpaths
common.configpaths.gajimpaths.init(None)
import gtkgui_helpers
from common import gajim
from gtkgui_helpers import get_icon_pixmap
from common import helpers
@ -1130,8 +1129,6 @@ class HtmlTextView(Gtk.TextView):
change_cursor = None
if __name__ == '__main__':
import os
from conversation_textview import ConversationTextview
import gajim as gaj

View File

@ -36,7 +36,7 @@ import gtkgui_helpers
from dialogs import WarningDialog, YesNoDialog, ArchiveChooserDialog
from htmltextview import HtmlTextView
from common import gajim
from plugins.helpers import log_calls, log
from plugins.helpers import log_calls
from plugins.helpers import GajimPluginActivateException
from plugins.plugins_i18n import _
from common.exceptions import PluginsystemError
@ -221,7 +221,6 @@ class PluginsWindow(object):
@log_calls('PluginsWindow')
def on_configure_plugin_button_clicked(self, widget):
#log.debug('widget: %s'%(widget))
selection = self.installed_plugins_treeview.get_selection()
model, iter = selection.get_selected()
if iter:

View File

@ -64,16 +64,12 @@ from common import gajim
from common import helpers
from common.exceptions import GajimGeneralException
from common import i18n
from common import pep
from common import location_listener
from common import ged
from common import dbus_support
from message_window import MessageWindowMgr
from common import dbus_support
if dbus_support.supported:
import dbus
from nbxmpp.protocol import NS_FILE, NS_ROSTERX, NS_CONFERENCE
#(icon, name, type, jid, account, editable, second pixbuf)

View File

@ -25,7 +25,6 @@
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GObject
import os
import dialogs
@ -35,7 +34,6 @@ import gtkgui_helpers
from common import gajim
from common import helpers
from common import pep
class StatusIcon:
"""

View File

@ -40,7 +40,6 @@ import gtkgui_helpers
from common import gajim
from common import helpers
from common.pep import MOODS, ACTIVITIES
from common.i18n import Q_
class BaseTooltip:

View File

@ -33,8 +33,6 @@ def on_suspend(*args, **kwargs):
conn.time_to_reconnect = 5
if dbus_support.supported:
import dbus
try:
from common.dbus_support import system_bus
bus = system_bus.bus()