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 gi.repository import Pango
from common import gajim from common import gajim
from common import helpers
( (
OPT_TYPE, OPT_TYPE,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -20,7 +20,6 @@ Handles Jingle contents (XEP 0166)
import os import os
from common import gajim from common import gajim
import nbxmpp import nbxmpp
from common.jingle_transport import JingleTransportIBB
from .jingle_xtls import SELF_SIGNED_CERTIFICATE from .jingle_xtls import SELF_SIGNED_CERTIFICATE
from .jingle_xtls import load_cert_file 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_content import contents, JingleContent
from common.jingle_transport import * from common.jingle_transport import *
from common import helpers from common import helpers
from common.socks5 import Socks5ReceiverClient, Socks5SenderClient
from common.connection_handlers_events import FileRequestReceivedEvent from common.connection_handlers_events import FileRequestReceivedEvent
import threading import threading
import logging import logging

View file

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

View file

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

View file

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

View file

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

View file

@ -36,7 +36,6 @@ import time
import nbxmpp import nbxmpp
from common import gajim from common import gajim
from common import helpers from common import helpers
from common import dataforms
from common import ged from common import ged
from common import jingle_xtls from common import jingle_xtls
from common.file_props import FilesProp 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 gajim
from common import ged from common import ged
from common import helpers
from common.connection_handlers_events import CapsPresenceReceivedEvent, \ from common.connection_handlers_events import CapsPresenceReceivedEvent, \
CapsDiscoReceivedEvent, CapsReceivedEvent CapsDiscoReceivedEvent, CapsReceivedEvent

View file

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

View file

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

View file

@ -26,7 +26,7 @@ except ImportError:
pass pass
from common.zeroconf.zeroconf import C_BARE_NAME, C_RESOLVED_INFO, \ 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: class Zeroconf:
def __init__(self, new_serviceCB, remove_serviceCB, name_conflictCB, 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 htmltextview import HtmlTextView
from common.exceptions import GajimGeneralException from common.exceptions import GajimGeneralException
from encodings.punycode import punycode_encode as puny_encode
NOT_SHOWN = 0 NOT_SHOWN = 0
ALREADY_RECEIVED = 1 ALREADY_RECEIVED = 1

View file

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

View file

@ -55,7 +55,6 @@ from common import i18n
from chat_control import ChatControl from chat_control import ChatControl
from chat_control_base import ChatControlBase from chat_control_base import ChatControlBase
from common.exceptions import GajimGeneralException
from command_system.implementation.hosts import PrivateChatCommands from command_system.implementation.hosts import PrivateChatCommands
from command_system.implementation.hosts import GroupChatCommands 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 proxy65_manager
from common import socks5 from common import socks5
from common import helpers from common import helpers
from common import dataforms
from common import passwords from common import passwords
from common import logging_helpers from common import logging_helpers
from common.connection_handlers_events import OurShowEvent, \ from common.connection_handlers_events import OurShowEvent, \
FileRequestErrorEvent, FileTransferCompletedEvent, InformationEvent FileRequestErrorEvent, FileTransferCompletedEvent
from common.connection import Connection from common.connection import Connection
from common import jingle
from common.file_props import FilesProp from common.file_props import FilesProp
from common import pep from common import pep

View file

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

View file

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

View file

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

View file

@ -64,16 +64,12 @@ from common import gajim
from common import helpers from common import helpers
from common.exceptions import GajimGeneralException from common.exceptions import GajimGeneralException
from common import i18n from common import i18n
from common import pep
from common import location_listener from common import location_listener
from common import ged from common import ged
from common import dbus_support
from message_window import MessageWindowMgr 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 from nbxmpp.protocol import NS_FILE, NS_ROSTERX, NS_CONFERENCE
#(icon, name, type, jid, account, editable, second pixbuf) #(icon, name, type, jid, account, editable, second pixbuf)

View file

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

View file

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

View file

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