changeset 193081600a08 in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: gajim_0.16 details:http://hg.gajim.org/gajim?cmd=changeset;node=193081600a08 description: [NooN8] Fix imports thanks to pyflakes. Fixes #8360
diffstat:
src/chat_control.py | 5 --- src/command_system/framework.py | 1 - src/command_system/implementation/custom.py | 2 +- src/command_system/implementation/execute.py | 2 +- src/command_system/implementation/standard.py | 3 +- src/command_system/tools.py | 3 +- src/common/caps_cache.py | 2 +- src/common/check_paths.py | 1 - src/common/config.py | 2 - src/common/connection.py | 19 +++++++++++++- src/common/connection_handlers.py | 29 +++++++++++++++----- src/common/dbus_support.py | 2 +- src/common/fuzzyclock.py | 1 - src/common/gajim.py | 2 - src/common/gnupg.py | 1 - src/common/jingle_content.py | 1 - src/common/jingle_ft.py | 8 +++-- src/common/jingle_ftstates.py | 2 +- src/common/jingle_session.py | 6 +++- src/common/jingle_transport.py | 1 - src/common/jingle_xtls.py | 1 - src/common/location_listener.py | 1 - src/common/optparser.py | 1 - src/common/pep.py | 1 - src/common/protocol/bytestream.py | 1 - src/common/protocol/caps.py | 1 - src/common/sleepy.py | 2 +- src/common/socks5.py | 1 + src/common/zeroconf/client_zeroconf.py | 4 +- src/common/zeroconf/connection_handlers_zeroconf.py | 4 -- src/common/zeroconf/connection_zeroconf.py | 8 +++-- src/common/zeroconf/zeroconf_avahi.py | 2 +- src/common/zeroconf/zeroconf_bonjour.py | 2 +- src/config.py | 2 +- src/conversation_textview.py | 2 - src/dialogs.py | 1 - src/disco.py | 1 - src/features_window.py | 1 - src/groupchat_control.py | 1 - src/gui_interface.py | 4 +-- src/history_manager.py | 1 - src/history_window.py | 1 + src/htmltextview.py | 5 ++- src/network_manager_listener.py | 1 - src/notify.py | 1 - src/plugins/gui.py | 2 +- src/roster_window.py | 2 - src/statusicon.py | 4 -- src/tooltips.py | 1 - src/upower_listener.py | 1 - 50 files changed, 76 insertions(+), 77 deletions(-)
diffs (truncated from 757 to 300 lines):
diff -r 4bac6da40720 -r 193081600a08 src/chat_control.py --- a/src/chat_control.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/chat_control.py Thu Jul 14 21:58:47 2016 +0200 @@ -52,7 +52,6 @@ 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 @@ -76,10 +75,6 @@ except ImportError: HAS_GTK_SPELL = False
-from common import dbus_support -if dbus_support.supported: - import dbus - import remote_control
################################################################################ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): diff -r 4bac6da40720 -r 193081600a08 src/command_system/framework.py --- a/src/command_system/framework.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/command_system/framework.py Thu Jul 14 21:58:47 2016 +0200 @@ -19,7 +19,6 @@ declarative way. """
-import re from types import FunctionType from inspect import getargspec, getdoc
diff -r 4bac6da40720 -r 193081600a08 src/command_system/implementation/custom.py --- a/src/command_system/implementation/custom.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/command_system/implementation/custom.py Thu Jul 14 21:58:47 2016 +0200 @@ -35,7 +35,7 @@ """
from ..framework import CommandContainer, command, doc -from hosts import * +from hosts import ChatCommands, PrivateChatCommands, GroupChatCommands
class CustomCommonCommands(CommandContainer): """ diff -r 4bac6da40720 -r 193081600a08 src/command_system/implementation/execute.py --- a/src/command_system/implementation/execute.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/command_system/implementation/execute.py Thu Jul 14 21:58:47 2016 +0200 @@ -38,7 +38,7 @@ from glib import timeout_add
from ..framework import CommandContainer, command, doc -from hosts import * +from hosts import ChatCommands, PrivateChatCommands, GroupChatCommands
class Execute(CommandContainer): AUTOMATIC = True diff -r 4bac6da40720 -r 193081600a08 src/command_system/implementation/standard.py --- a/src/command_system/implementation/standard.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/command_system/implementation/standard.py Thu Jul 14 21:58:47 2016 +0200 @@ -30,8 +30,7 @@ from ..framework import CommandContainer, command, doc from ..mapping import generate_usage
-from hosts import * -import execute +from hosts import PrivateChatCommands, GroupChatCommands, ChatCommands
# This holds constants fron the logger, which we'll be using in some of our # commands. diff -r 4bac6da40720 -r 193081600a08 src/command_system/tools.py --- a/src/command_system/tools.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/command_system/tools.py Thu Jul 14 21:58:47 2016 +0200 @@ -24,8 +24,9 @@ # (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 * from glib import GError +from types import DictType, ListType +
def remove(sequence, target): if isinstance(sequence, ListType): diff -r 4bac6da40720 -r 193081600a08 src/common/caps_cache.py --- a/src/common/caps_cache.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/common/caps_cache.py Thu Jul 14 21:58:47 2016 +0200 @@ -38,7 +38,7 @@ 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 -r 4bac6da40720 -r 193081600a08 src/common/check_paths.py --- a/src/common/check_paths.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/common/check_paths.py Thu Jul 14 21:58:47 2016 +0200 @@ -26,7 +26,6 @@ import os import shutil import sys -import stat
from common import gajim import logger diff -r 4bac6da40720 -r 193081600a08 src/common/config.py --- a/src/common/config.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/common/config.py Thu Jul 14 21:58:47 2016 +0200 @@ -32,9 +32,7 @@ ##
-import sys import re -import copy import defs import gobject
diff -r 4bac6da40720 -r 193081600a08 src/common/connection.py --- a/src/common/connection.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/common/connection.py Thu Jul 14 21:58:47 2016 +0200 @@ -42,6 +42,24 @@ import hmac import json
+import common +from common.connection_handlers import BLOCKING_ARRIVED, PRIVACY_ARRIVED, AGENT_REMOVED, \ + ConnectionHandlers, DELIMITER_ARRIVED, METACONTACTS_ARRIVED, ROSTER_ARRIVED +from common.connection_handlers_events import InformationEvent, \ + UniqueRoomIdNotSupportedEvent, UniqueRoomIdSupportedEvent, GatewayPromptReceivedEvent, \ + NewAccountNotConnectedEvent, StanzaMessageOutgoingEvent, OurShowEvent, SignedInEvent, \ + PrivacyListRemovedEvent, PingReplyEvent, PingErrorEvent, PingSentEvent, \ + AnonymousAuthEvent, ConnectionLostEvent, ConnectionTypeEvent, SSLErrorEvent, \ + FingerprintErrorEvent, InsecureSSLConnectionEvent, ClientCertPassphraseEvent, \ + PlainConnectionEvent, PrivacyListReceivedEvent, PrivacyListActiveDefaultEvent, \ + PrivacyListsReceivedEvent, RegisterAgentInfoReceivedEvent, NewAccountConnectedEvent, \ + AccountCreatedEvent, AccountNotCreatedEvent, BeforeChangeShowEvent, StanzaSentEvent, \ + StanzaReceivedEvent, MessageNotSentEvent, GPGTrustKeyEvent, BadGPGPassphraseEvent +from common.connection_handlers_events import InsecurePasswordEvent, MessageSentEvent, \ + NonAnonymousServerErrorEvent, Oauth2CredentialsRequiredEvent, PasswordRequiredEvent, \ + RosterReceivedEvent, SearchResultReceivedEvent +import common.ged as ged + try: randomsource = random.SystemRandom() except Exception: @@ -59,7 +77,6 @@ from common import passwords from common import exceptions from common import check_X509 -from connection_handlers import *
if gajim.HAVE_PYOPENSSL: import OpenSSL.crypto diff -r 4bac6da40720 -r 193081600a08 src/common/connection_handlers.py --- a/src/common/connection_handlers.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/common/connection_handlers.py Thu Jul 14 21:58:47 2016 +0200 @@ -30,24 +30,41 @@
import os import base64 -import sys import operator import hashlib import gobject -import locale
-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
import nbxmpp import common.caps_cache as capscache +from common.connection_handlers_events import InformationEvent, \ + AgentItemsErrorReceivedEvent, AgentInfoErrorReceivedEvent, RosterInfoEvent, \ + BadGPGPassphraseEvent, SignedInEvent, MucOwnerReceivedEvent, MucAdminReceivedEvent, \ + PingReceivedEvent, OurShowEvent, StreamReceivedEvent, BlockingEvent, \ + SearchFormReceivedEvent, GPGPasswordRequiredEvent, RosterReceivedEvent, \ + GMailQueryReceivedEvent, RosterItemExchangeEvent, TimeRevisedRequestEvent, \ + GcMessageReceivedEvent, TimeRequestEvent, VersionResultReceivedEvent, \ + PrivateStorageReceivedEvent, RosterSetReceivedEvent, VersionRequestEvent, \ + LastRequestEvent, TimeResultReceivedEvent, GmailNewMailReceivedEvent, \ + PrivateStorageBookmarksReceivedEvent, BookmarksReceivedEvent, \ + PrivateStorageRosternotesReceivedEvent, RosternotesReceivedEvent, \ + StreamConflictReceivedEvent, StreamOtherHostReceivedEvent, MessageReceivedEvent, \ + ArchivingErrorReceivedEvent, ArchivingPreferencesChangedReceivedEvent, \ + NotificationEvent, GcInvitationReceivedEvent, GcDeclineReceivedEvent, \ + MessageErrorEvent, LastResultReceivedEvent, PresenceReceivedEvent, FailedDecryptEvent, \ + DecryptedMessageReceivedEvent, MamDecryptedMessageReceivedEvent, HttpAuthReceivedEvent, \ + IqErrorReceivedEvent, VcardReceivedEvent, AgentRemovedEvent, MetacontactsReceivedEvent, \ + PEPConfigReceivedEvent, PEPReceivedEvent, AgentItemsReceivedEvent, \ + AgentInfoReceivedEvent, VcardPublishedEvent, VcardNotPublishedEvent +#from common.connection_handlers_events import * +from common.logger import LOG_DB_PATH
from pep import LOCATION_DATA from common import helpers from common import gajim from common import exceptions -from common import dataforms from common import jingle_xtls from common.commands import ConnectionCommands from common.pubsub import ConnectionPubSub @@ -56,10 +73,8 @@ from common.protocol.bytestream import ConnectionIBBytestream from common.message_archiving import ConnectionArchive136 from common.message_archiving import ConnectionArchive313 -from common.connection_handlers_events import *
from common import ged -from common import nec from common.nec import NetworkEvent
from common.jingle import ConnectionJingle diff -r 4bac6da40720 -r 193081600a08 src/common/dbus_support.py --- a/src/common/dbus_support.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/common/dbus_support.py Thu Jul 14 21:58:47 2016 +0200 @@ -24,7 +24,7 @@ ## along with Gajim. If not, see http://www.gnu.org/licenses/. ##
-import os, sys +import os
from common import gajim from common import exceptions diff -r 4bac6da40720 -r 193081600a08 src/common/fuzzyclock.py --- a/src/common/fuzzyclock.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/common/fuzzyclock.py Thu Jul 14 21:58:47 2016 +0200 @@ -32,7 +32,6 @@ So most of the credit goes to this guys, thanks :-) """
-import time
class FuzzyClock: HOUR_NAMES = [ _('twelve'), _('one'), _('two'), _('three'), _('four'), diff -r 4bac6da40720 -r 193081600a08 src/common/gajim.py --- a/src/common/gajim.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/common/gajim.py Thu Jul 14 21:58:47 2016 +0200 @@ -27,7 +27,6 @@ ## along with Gajim. If not, see http://www.gnu.org/licenses/. ##
-import sys import os import logging import locale @@ -35,7 +34,6 @@
import config import nbxmpp -import defs import common.ged
interface = None # The actual interface (the gtk one for the moment) diff -r 4bac6da40720 -r 193081600a08 src/common/gnupg.py --- a/src/common/gnupg.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/common/gnupg.py Thu Jul 14 21:58:47 2016 +0200 @@ -42,7 +42,6 @@ from cStringIO import StringIO
import codecs -import locale import logging import os import re diff -r 4bac6da40720 -r 193081600a08 src/common/jingle_content.py --- a/src/common/jingle_content.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/common/jingle_content.py Thu Jul 14 21:58:47 2016 +0200 @@ -20,7 +20,6 @@ import os import gajim import nbxmpp -from jingle_transport import JingleTransportIBB from jingle_xtls import SELF_SIGNED_CERTIFICATE from jingle_xtls import load_cert_file
diff -r 4bac6da40720 -r 193081600a08 src/common/jingle_ft.py --- a/src/common/jingle_ft.py Thu Jul 14 21:45:39 2016 +0200 +++ b/src/common/jingle_ft.py Thu Jul 14 21:58:47 2016 +0200 @@ -25,14 +25,16 @@ import nbxmpp import configpaths import jingle_xtls +from common.jingle_ftstates import StateCandReceived, JingleTransportSocks5, \ + StateCandSent, StateCandSentAndRecv, StateInitialized, StateTransfering,\ + StateTransportReplace +from common.jingle_transport import TransportType from jingle_content import contents, JingleContent -from jingle_transport import * from common import helpers -from common.socks5 import Socks5ReceiverClient, Socks5SenderClient from common.connection_handlers_events import FileRequestReceivedEvent import threading import logging -from jingle_ftstates import *