diff --git a/src/chat_control.py b/src/chat_control.py index 747a3a67d..691f5d958 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -29,9 +29,6 @@ import os import time -import gi -gi.require_version('GdkX11', '3.0') -from gi.repository import GdkX11 from gi.repository import Gtk from gi.repository import Gdk from gi.repository import GdkPixbuf @@ -58,7 +55,6 @@ from message_textview import MessageTextView from common.stanza_session import EncryptedStanzaSession, ArchivingStanzaSession from common.contacts import GC_Contact from common.logger import constants -from common.pep import MOODS, ACTIVITIES from nbxmpp.protocol import NS_XHTML, NS_XHTML_IM, NS_FILE, NS_MUC from nbxmpp.protocol import NS_RECEIPTS, NS_ESESSION from nbxmpp.protocol import NS_JINGLE_RTP_AUDIO, NS_JINGLE_RTP_VIDEO diff --git a/src/common/caps_cache.py b/src/common/caps_cache.py index 7108c179f..2d1ed9d2b 100644 --- a/src/common/caps_cache.py +++ b/src/common/caps_cache.py @@ -38,7 +38,7 @@ import logging log = logging.getLogger('gajim.c.caps_cache') from nbxmpp import (NS_XHTML_IM, NS_RECEIPTS, NS_ESESSION, NS_CHATSTATES, - NS_JINGLE_ICE_UDP, NS_JINGLE_RTP_AUDIO, NS_JINGLE_RTP_VIDEO, NS_CAPS, + NS_JINGLE_ICE_UDP, NS_JINGLE_RTP_AUDIO, NS_JINGLE_RTP_VIDEO, NS_JINGLE_FILE_TRANSFER) # Features where we cannot safely assume that the other side supports them FEATURE_BLACKLIST = [NS_CHATSTATES, NS_XHTML_IM, NS_RECEIPTS, NS_ESESSION, diff --git a/src/common/check_paths.py b/src/common/check_paths.py index 417d02dd3..5e92c324a 100644 --- a/src/common/check_paths.py +++ b/src/common/check_paths.py @@ -26,7 +26,6 @@ import os import shutil import sys -import stat from common import gajim from common import logger diff --git a/src/common/config.py b/src/common/config.py index 5649f8118..79368347a 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -32,9 +32,7 @@ ## -import sys import re -import copy from common import defs from gi.repository import GLib diff --git a/src/common/dbus_support.py b/src/common/dbus_support.py index 87ead7f39..cd4611152 100644 --- a/src/common/dbus_support.py +++ b/src/common/dbus_support.py @@ -24,7 +24,7 @@ ## along with Gajim. If not, see . ## -import os, sys +import os from common import gajim from common import exceptions diff --git a/src/common/fuzzyclock.py b/src/common/fuzzyclock.py index f9a1bf328..79fded35f 100755 --- a/src/common/fuzzyclock.py +++ b/src/common/fuzzyclock.py @@ -32,7 +32,6 @@ in turn based on the Fuzzy Clock Applet of Frerich Raabe (KDE). So most of the credit goes to this guys, thanks :-) """ -import time class FuzzyClock: HOUR_NAMES = [ _('twelve'), _('one'), _('two'), _('three'), _('four'), diff --git a/src/common/gajim.py b/src/common/gajim.py index 24cfda774..f9ba812df 100644 --- a/src/common/gajim.py +++ b/src/common/gajim.py @@ -27,7 +27,6 @@ ## along with Gajim. If not, see . ## -import sys import os import logging import locale @@ -201,10 +200,6 @@ try: from gi.repository import Farstream gi.require_version('Gst', '1.0') from gi.repository import Gst - gi.require_version('GdkX11', '3.0') - from gi.repository import GdkX11 - gi.require_version('GstVideo', '1.0') - from gi.repository import GstVideo from gi.repository import GLib try: Gst.init(None) diff --git a/src/common/helpers.py b/src/common/helpers.py index 4d3d3166c..c611c04a9 100644 --- a/src/common/helpers.py +++ b/src/common/helpers.py @@ -31,7 +31,6 @@ import sys import re -import locale import os import subprocess import urllib diff --git a/src/common/jingle_rtp.py b/src/common/jingle_rtp.py index f78d81018..c94666922 100644 --- a/src/common/jingle_rtp.py +++ b/src/common/jingle_rtp.py @@ -17,20 +17,13 @@ Handles Jingle RTP sessions (XEP 0167) """ -from collections import deque - -from gi.repository import GLib import socket - import nbxmpp -from gi.repository import Farstream import gi +from gi.repository import Farstream + gi.require_version('Gst', '1.0') from gi.repository import Gst -gi.require_version('GdkX11', '3.0') -from gi.repository import GdkX11 -gi.require_version('GstVideo', '1.0') -from gi.repository import GstVideo from gi.repository import GLib from common import gajim @@ -40,6 +33,7 @@ from common.jingle_content import contents, JingleContent, JingleContentSetupExc from common.connection_handlers_events import InformationEvent from common.jingle_session import FailedApplication +from collections import deque import logging log = logging.getLogger('gajim.c.jingle_rtp') diff --git a/src/common/logging_helpers.py b/src/common/logging_helpers.py index ec5dfe70d..7922b8dab 100644 --- a/src/common/logging_helpers.py +++ b/src/common/logging_helpers.py @@ -19,7 +19,6 @@ ## import logging -from common import i18n def parseLogLevel(arg): """ diff --git a/src/common/multimedia_helpers.py b/src/common/multimedia_helpers.py index 910c00d93..c41ceed52 100644 --- a/src/common/multimedia_helpers.py +++ b/src/common/multimedia_helpers.py @@ -16,10 +16,6 @@ import gi gi.require_version('Gst', '1.0') from gi.repository import Gst -gi.require_version('GdkX11', '3.0') -from gi.repository import GdkX11 -gi.require_version('GstVideo', '1.0') -from gi.repository import GstVideo class DeviceManager(object): diff --git a/src/common/optparser.py b/src/common/optparser.py index e11bd3a38..4bfed3e2e 100644 --- a/src/common/optparser.py +++ b/src/common/optparser.py @@ -28,7 +28,6 @@ import os import sys -import locale import re from time import time from common import gajim diff --git a/src/common/resolver.py b/src/common/resolver.py index 6b3940aeb..736463655 100644 --- a/src/common/resolver.py +++ b/src/common/resolver.py @@ -18,8 +18,6 @@ ## import sys -import os -import re import logging import functools log = logging.getLogger('gajim.c.resolver') @@ -30,8 +28,6 @@ if __name__ == '__main__': import common.configpaths common.configpaths.gajimpaths.init(None) -from common import helpers -from nbxmpp.idlequeue import IdleCommand from gi.repository import Gio, GLib @@ -132,7 +128,6 @@ class GioResolver(CommonResolver): # below lines is on how to use API and assist in testing if __name__ == '__main__': - from gi.repository import GLib from gi.repository import Gtk from nbxmpp import idlequeue diff --git a/src/common/sleepy.py b/src/common/sleepy.py index b7c437d7d..ca1a34d3e 100644 --- a/src/common/sleepy.py +++ b/src/common/sleepy.py @@ -23,7 +23,6 @@ from common import gajim import os -import sys STATE_UNKNOWN = 'OS probably not supported' diff --git a/src/config.py b/src/config.py index 5885e15a3..53339c4a4 100644 --- a/src/config.py +++ b/src/config.py @@ -36,7 +36,7 @@ from gi.repository import Gdk from gi.repository import Pango from gi.repository import GObject from gi.repository import GLib -import os, sys +import os import common.config import common.sleepy from common.i18n import Q_ diff --git a/src/conversation_textview.py b/src/conversation_textview.py index cdaedd47b..fd34bd049 100644 --- a/src/conversation_textview.py +++ b/src/conversation_textview.py @@ -39,7 +39,6 @@ import time import os import tooltips import dialogs -import locale import queue import urllib diff --git a/src/dialogs.py b/src/dialogs.py index 05cfae0ac..e85749ca5 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -42,7 +42,6 @@ import time import gtkgui_helpers import vcard import conversation_textview -import message_control import dataforms_widget from common import defs diff --git a/src/disco.py b/src/disco.py index 51871b4e0..3519a3af5 100644 --- a/src/disco.py +++ b/src/disco.py @@ -44,7 +44,6 @@ # the functionality) # There are more methods, of course, but this is a basic set. -import os import types import weakref from gi.repository import GLib diff --git a/src/features_window.py b/src/features_window.py index 23df54467..19ef8b3fc 100644 --- a/src/features_window.py +++ b/src/features_window.py @@ -24,7 +24,6 @@ ## import os -import sys import gi from gi.repository import Gtk import gtkgui_helpers diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py index 4499a0158..643cfd052 100644 --- a/src/gtkgui_helpers.py +++ b/src/gtkgui_helpers.py @@ -36,13 +36,11 @@ from gi.repository import GLib from gi.repository import Pango import os import sys -import importlib try: from PIL import Image except: pass from io import BytesIO -import array import logging log = logging.getLogger('gajim.gtkgui_helpers') diff --git a/src/history_manager.py b/src/history_manager.py index b99e0f158..b32935b5f 100644 --- a/src/history_manager.py +++ b/src/history_manager.py @@ -52,7 +52,6 @@ import signal import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk -gi.require_version('GdkX11', '3.0') from gi.repository import Gdk from gi.repository import GLib import time diff --git a/src/htmltextview.py b/src/htmltextview.py index 31e8f67a0..decd31076 100644 --- a/src/htmltextview.py +++ b/src/htmltextview.py @@ -41,11 +41,11 @@ from gi.repository import Pango from gi.repository import Gtk from gi.repository import Gdk from gi.repository import GdkPixbuf -import xml.sax, xml.sax.handler +import xml.sax +import xml.sax.handler import re from io import StringIO import urllib -import operator if __name__ == '__main__': from common import i18n diff --git a/src/message_textview.py b/src/message_textview.py index e266830f5..eb253da97 100644 --- a/src/message_textview.py +++ b/src/message_textview.py @@ -24,12 +24,10 @@ import gc from gi.repository import Gtk -from gi.repository import Gdk from gi.repository import GObject from gi.repository import GLib from gi.repository import Pango -import gtkgui_helpers from common import gajim class MessageTextView(Gtk.TextView): diff --git a/src/network_manager_listener.py b/src/network_manager_listener.py index 225fc9ad9..ff5e8a27c 100644 --- a/src/network_manager_listener.py +++ b/src/network_manager_listener.py @@ -21,7 +21,6 @@ ## along with Gajim. If not, see . ## -import sys from common import gajim diff --git a/src/notify.py b/src/notify.py index 1e1c9f0e1..72066bccb 100644 --- a/src/notify.py +++ b/src/notify.py @@ -33,7 +33,6 @@ from dialogs import PopupNotificationWindow from gi.repository import GObject from gi.repository import GLib import gtkgui_helpers -from gi.repository import Gtk from common import gajim from common import helpers diff --git a/src/roster_window.py b/src/roster_window.py index aa8cbfe41..b4427a4ef 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -74,7 +74,6 @@ if dbus_support.supported: import dbus from nbxmpp.protocol import NS_FILE, NS_ROSTERX, NS_CONFERENCE -from common.pep import MOODS, ACTIVITIES #(icon, name, type, jid, account, editable, second pixbuf) ( diff --git a/src/statusicon.py b/src/statusicon.py index a7a1292d5..fb452a9aa 100644 --- a/src/statusicon.py +++ b/src/statusicon.py @@ -23,7 +23,6 @@ ## along with Gajim. If not, see . ## -import sys from gi.repository import Gtk from gi.repository import Gdk from gi.repository import GObject @@ -33,7 +32,6 @@ import dialogs import config import tooltips import gtkgui_helpers -import tooltips from common import gajim from common import helpers diff --git a/src/tooltips.py b/src/tooltips.py index fadb4dfb6..2cb8fa6bc 100644 --- a/src/tooltips.py +++ b/src/tooltips.py @@ -33,7 +33,6 @@ from gi.repository import Gdk from gi.repository import GLib import os import time -import locale from datetime import datetime from datetime import timedelta