Fix unsued-import pylint errors

This commit is contained in:
Philipp Hörist 2018-09-16 11:37:38 +02:00 committed by Philipp Hörist
parent 4cf7d20600
commit d011be2d89
15 changed files with 40 additions and 52 deletions

View File

@ -24,10 +24,11 @@
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
import os
import re
import time
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import Pango
from gi.repository import GLib
from gi.repository import Gio
@ -36,8 +37,6 @@ from gajim import message_control
from gajim.gtk import NonModalConfirmationDialog
from gajim.gtk.util import convert_rgb_to_hex
from gajim import notify
import re
from gajim.gtk.emoji_chooser import emoji_chooser
from gajim.common import events
from gajim.common import app
@ -58,8 +57,10 @@ from gajim.command_system.implementation.middleware import CommandTools
# module, but still they need to be kept around. Importing them automatically
# registers the contained CommandContainers with the command system, thereby
# populating the list of available commands.
# pylint: disable=unused-import
from gajim.command_system.implementation import standard
from gajim.command_system.implementation import execute
# pylint: enable=unused-import
if app.is_installed('GSPELL'):
from gi.repository import Gspell

View File

@ -20,11 +20,9 @@ Provides an actual implementation for the standard commands.
from time import localtime, strftime
from datetime import date
from gajim import dialogs
from gajim.common import app
from gajim.common import helpers
from gajim.common.i18n import _
from gajim.common.exceptions import GajimGeneralException
from gajim.common.const import KindConstant
from gajim.command_system.errors import CommandError
@ -33,6 +31,7 @@ from gajim.command_system.mapping import generate_usage
from gajim.command_system.implementation.hosts import ChatCommands, PrivateChatCommands, GroupChatCommands
class StandardCommonCommands(CommandContainer):
"""
This command container contains standard commands which are common

View File

@ -18,8 +18,6 @@
# pylint: disable=attribute-defined-outside-init
from calendar import timegm
import hashlib
import hmac
import logging
from time import time as time_time

View File

@ -23,7 +23,6 @@
import sys
import logging
from gajim.common import app
from gajim.common import exceptions
from gajim.common.i18n import _

View File

@ -36,24 +36,24 @@ import select
import base64
import hashlib
import shlex
from gajim.common import caps_cache
import socket
import time
import logging
from datetime import datetime, timedelta
from distutils.version import LooseVersion as V
from encodings.punycode import punycode_encode
from string import Template
import nbxmpp
from gajim.common import caps_cache
from gajim.common import configpaths
from gajim.common.i18n import Q_
from gajim.common.i18n import _
from gajim.common.i18n import ngettext
from gajim.common import configpaths
try:
import precis_i18n.codec
import precis_i18n.codec # pylint: disable=unused-import
HAS_PRECIS_I18N = True
except ImportError:
HAS_PRECIS_I18N = False
@ -81,7 +81,6 @@ try:
except Exception:
pass
import logging
log = logging.getLogger('gajim.c.helpers')
special_groups = (_('Transports'), _('Not in Roster'), _('Observers'), _('Groupchats'))

View File

@ -29,10 +29,12 @@ Handles Jingle sessions (XEP 0166)
import logging
from enum import Enum, unique
import nbxmpp
from gajim.common import app
from gajim.common.jingle_transport import get_jingle_transport, JingleTransportIBB
from gajim.common.jingle_content import get_jingle_content, JingleContentSetupException, JingleContent
from gajim.common.jingle_content import get_jingle_content, JingleContentSetupException
from gajim.common.jingle_ft import State
from gajim.common.connection_handlers_events import (
FilesProp, JingleRequestReceivedEvent, JingleDisconnectedReceivedEvent,

View File

@ -16,7 +16,6 @@
import logging
import copy
from typing import Optional
from collections import OrderedDict
import nbxmpp

View File

@ -16,7 +16,6 @@ from gi.repository import Gtk
from gajim.common import app
from gajim.common import helpers
from gajim.common.modules import dataforms
from gajim.gtk.util import get_builder
from gajim.gtk.util import load_icon

View File

@ -18,7 +18,6 @@ from gi.repository import Gdk
from gajim.common import app
from gajim.common import helpers
from gajim.common import ged
from gajim.common.caps_cache import muc_caps_cache
from gajim.common.exceptions import GajimGeneralException
from gajim.gtk import ErrorDialog

View File

@ -14,17 +14,18 @@
# You should have received a copy of the GNU General Public License
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
from gi.repository import Gtk, Gio, GLib
import os
from gajim import gtkgui_helpers
from gajim import message_control
from gajim.common import app
from gajim.common import helpers
from gajim.common import i18n
from gi.repository import Gtk, Gio, GLib
from nbxmpp.protocol import NS_COMMANDS, NS_FILE, NS_MUC
from nbxmpp.protocol import NS_JINGLE_FILE_TRANSFER_5, NS_CONFERENCE
from gajim import gtkgui_helpers
from gajim import message_control
from gajim.gtkgui_helpers import get_action
from gajim.common import app
from gajim.common import helpers
def build_resources_submenu(contacts, account, action, room_jid=None,
room_account=None, cap=None):

View File

@ -31,32 +31,33 @@ with the markup that docutils generate, and also more
modular.
"""
import re
import logging
import urllib
import xml.sax
import xml.sax.handler
from io import StringIO
from gi.repository import GObject
from gi.repository import Pango
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GdkPixbuf
import xml.sax
import xml.sax.handler
import re
from io import StringIO
import urllib
if __name__ == '__main__':
from gajim.common import i18n
from gajim.common import configpaths
configpaths.init()
from gajim.common import app
from gajim.common import helpers
from gajim.common.i18n import _
from gajim.common.const import StyleAttr
from gajim.gtk import JoinGroupchatWindow
from gajim.gtk import AddNewContactWindow
from gajim.gtk.util import load_icon
from gajim.gtk.util import get_cursor
from gajim.gtk.util import get_builder
from gajim.common import helpers
from gajim.gtk import JoinGroupchatWindow
from gajim.gtk import AddNewContactWindow
from gajim.common.const import StyleAttr
import logging
log = logging.getLogger('gajim.htmlview')
__all__ = ['HtmlTextView']
@ -1096,11 +1097,6 @@ change_cursor = None
if __name__ == '__main__':
from gajim.conversation_textview import ConversationTextview
from gajim.gui_interface import Interface
from gajim.common import app, logger, caps_cache
# TODO: don't call Logger() it will create the DB
# maybe mock this object for tests
# app.logger = logger.Logger()
# caps_cache.initialize(app.logger)
Interface()

View File

@ -20,7 +20,6 @@ import os
import locale
import gettext
from gajim.common import app
from gajim.common import configpaths
APP = 'gajim_plugins'
@ -36,5 +35,4 @@ try:
t = gettext.translation(APP, plugins_locale_dir)
_ = t.gettext
except IOError:
from gajim.common import i18n
_ = gettext.gettext

View File

@ -21,16 +21,15 @@ import string
import random
import itertools
from gajim import message_control
from gajim import notify
from gajim.common import helpers
from gajim.common import events
from gajim.common import app
from gajim.common import contacts
from gajim.common import ged
from gajim.common.connection_handlers_events import ChatstateReceivedEvent, \
InformationEvent
from gajim.common.connection_handlers_events import ChatstateReceivedEvent
from gajim.common.const import KindConstant
from gajim import message_control
from gajim import notify
from gajim.gtk import SingleMessageWindow

View File

@ -25,7 +25,6 @@ from gi.repository import Gtk
from gi.repository import Gdk
from gajim import dialogs
from gajim import config
from gajim import tooltips
from gajim import gtkgui_helpers
from gajim.common import app

View File

@ -25,16 +25,15 @@
# You should have received a copy of the GNU General Public License
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
import os
import base64
import binascii
from gi.repository import Gtk
from gi.repository import GLib
from gi.repository import Gdk
from gi.repository import GdkPixbuf
import base64
import binascii
import os
from gajim import gtkgui_helpers
from gajim.common import helpers
from gajim.common import app
from gajim.common import ged
@ -44,6 +43,7 @@ from gajim.common.const import AvatarSize
# log = logging.getLogger('gajim.vcard')
class VcardWindow:
"""
Class for contact's information window