summaryrefslogtreecommitdiff
path: root/sleekxmpp
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2013-07-29 02:24:33 -0700
committerLance Stout <lancestout@gmail.com>2013-07-29 02:24:33 -0700
commitd439c4f21515813b69f8e39d430cee8ca9a3c946 (patch)
treee8a4970b42759c9fcebe01a18a56bddaf0d88214 /sleekxmpp
parent85bc6f530178f3b049ea2ae064f168b77aeee332 (diff)
parenta9f2e1482ca65a919a7a9f0c44af7f9f51907887 (diff)
downloadslixmpp-d439c4f21515813b69f8e39d430cee8ca9a3c946.tar.gz
slixmpp-d439c4f21515813b69f8e39d430cee8ca9a3c946.tar.bz2
slixmpp-d439c4f21515813b69f8e39d430cee8ca9a3c946.tar.xz
slixmpp-d439c4f21515813b69f8e39d430cee8ca9a3c946.zip
Merge pull request #252 from jpcaruana/develop
refactor : optimize imports + replace mutable argument (a list) in StateMachine constructor
Diffstat (limited to 'sleekxmpp')
-rw-r--r--sleekxmpp/__init__.py1
-rw-r--r--sleekxmpp/basexmpp.py6
-rw-r--r--sleekxmpp/features/feature_bind/bind.py2
-rw-r--r--sleekxmpp/features/feature_mechanisms/mechanisms.py1
-rw-r--r--sleekxmpp/features/feature_preapproval/preapproval.py2
-rw-r--r--sleekxmpp/features/feature_rosterver/rosterver.py2
-rw-r--r--sleekxmpp/plugins/xep_0082.py1
-rw-r--r--sleekxmpp/roster/__init__.py1
-rw-r--r--sleekxmpp/test/sleektest.py6
-rw-r--r--sleekxmpp/thirdparty/socks.py6
-rw-r--r--sleekxmpp/thirdparty/statemachine.py3
-rw-r--r--sleekxmpp/util/stringprep_profiles.py1
12 files changed, 10 insertions, 22 deletions
diff --git a/sleekxmpp/__init__.py b/sleekxmpp/__init__.py
index f0dc2ce2..054a7aa0 100644
--- a/sleekxmpp/__init__.py
+++ b/sleekxmpp/__init__.py
@@ -14,6 +14,5 @@ from sleekxmpp.jid import JID, InvalidJID
from sleekxmpp.xmlstream.handler import *
from sleekxmpp.xmlstream import XMLStream, RestartStream
from sleekxmpp.xmlstream.matcher import *
-from sleekxmpp.xmlstream.stanzabase import StanzaBase, ET
from sleekxmpp.version import __version__, __version_info__
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py
index a54e4bb6..7b608d13 100644
--- a/sleekxmpp/basexmpp.py
+++ b/sleekxmpp/basexmpp.py
@@ -19,14 +19,13 @@ import logging
import threading
import sleekxmpp
-from sleekxmpp import plugins, features, roster
+from sleekxmpp import plugins, roster
from sleekxmpp.api import APIRegistry
from sleekxmpp.exceptions import IqError, IqTimeout
from sleekxmpp.stanza import Message, Presence, Iq, StreamError
from sleekxmpp.stanza.roster import Roster
from sleekxmpp.stanza.nick import Nick
-from sleekxmpp.stanza.htmlim import HTMLIM
from sleekxmpp.xmlstream import XMLStream, JID
from sleekxmpp.xmlstream import ET, register_stanza_plugin
@@ -34,8 +33,7 @@ from sleekxmpp.xmlstream.matcher import MatchXPath
from sleekxmpp.xmlstream.handler import Callback
from sleekxmpp.xmlstream.stanzabase import XML_NS
-from sleekxmpp.features import *
-from sleekxmpp.plugins import PluginManager, register_plugin, load_plugin
+from sleekxmpp.plugins import PluginManager, load_plugin
log = logging.getLogger(__name__)
diff --git a/sleekxmpp/features/feature_bind/bind.py b/sleekxmpp/features/feature_bind/bind.py
index bc145620..ee4c1e9b 100644
--- a/sleekxmpp/features/feature_bind/bind.py
+++ b/sleekxmpp/features/feature_bind/bind.py
@@ -12,7 +12,7 @@ from sleekxmpp.jid import JID
from sleekxmpp.stanza import Iq, StreamFeatures
from sleekxmpp.features.feature_bind import stanza
from sleekxmpp.xmlstream import register_stanza_plugin
-from sleekxmpp.plugins import BasePlugin, register_plugin
+from sleekxmpp.plugins import BasePlugin
log = logging.getLogger(__name__)
diff --git a/sleekxmpp/features/feature_mechanisms/mechanisms.py b/sleekxmpp/features/feature_mechanisms/mechanisms.py
index 58ed9b91..ca94bce1 100644
--- a/sleekxmpp/features/feature_mechanisms/mechanisms.py
+++ b/sleekxmpp/features/feature_mechanisms/mechanisms.py
@@ -6,7 +6,6 @@
See the file LICENSE for copying permission.
"""
-import sys
import ssl
import logging
diff --git a/sleekxmpp/features/feature_preapproval/preapproval.py b/sleekxmpp/features/feature_preapproval/preapproval.py
index 3823c472..c7106ed3 100644
--- a/sleekxmpp/features/feature_preapproval/preapproval.py
+++ b/sleekxmpp/features/feature_preapproval/preapproval.py
@@ -8,7 +8,7 @@
import logging
-from sleekxmpp.stanza import Iq, StreamFeatures
+from sleekxmpp.stanza import StreamFeatures
from sleekxmpp.features.feature_preapproval import stanza
from sleekxmpp.xmlstream import register_stanza_plugin
from sleekxmpp.plugins.base import BasePlugin
diff --git a/sleekxmpp/features/feature_rosterver/rosterver.py b/sleekxmpp/features/feature_rosterver/rosterver.py
index 9e0bb8e8..2991f587 100644
--- a/sleekxmpp/features/feature_rosterver/rosterver.py
+++ b/sleekxmpp/features/feature_rosterver/rosterver.py
@@ -8,7 +8,7 @@
import logging
-from sleekxmpp.stanza import Iq, StreamFeatures
+from sleekxmpp.stanza import StreamFeatures
from sleekxmpp.features.feature_rosterver import stanza
from sleekxmpp.xmlstream import register_stanza_plugin
from sleekxmpp.plugins.base import BasePlugin
diff --git a/sleekxmpp/plugins/xep_0082.py b/sleekxmpp/plugins/xep_0082.py
index 02571fa7..26eb68fa 100644
--- a/sleekxmpp/plugins/xep_0082.py
+++ b/sleekxmpp/plugins/xep_0082.py
@@ -6,7 +6,6 @@
See the file LICENSE for copying permission.
"""
-import logging
import datetime as dt
from sleekxmpp.plugins import BasePlugin, register_plugin
diff --git a/sleekxmpp/roster/__init__.py b/sleekxmpp/roster/__init__.py
index 4335d367..18b380c9 100644
--- a/sleekxmpp/roster/__init__.py
+++ b/sleekxmpp/roster/__init__.py
@@ -6,7 +6,6 @@
See the file LICENSE for copying permission.
"""
-from sleekxmpp.xmlstream import JID
from sleekxmpp.roster.item import RosterItem
from sleekxmpp.roster.single import RosterNode
from sleekxmpp.roster.multi import Roster
diff --git a/sleekxmpp/test/sleektest.py b/sleekxmpp/test/sleektest.py
index 901c3a56..04fb106d 100644
--- a/sleekxmpp/test/sleektest.py
+++ b/sleekxmpp/test/sleektest.py
@@ -9,14 +9,12 @@
import unittest
from xml.parsers.expat import ExpatError
-import sleekxmpp
from sleekxmpp import ClientXMPP, ComponentXMPP
from sleekxmpp.util import Queue
from sleekxmpp.stanza import Message, Iq, Presence
from sleekxmpp.test import TestSocket, TestLiveSocket
-from sleekxmpp.exceptions import XMPPError, IqTimeout, IqError
-from sleekxmpp.xmlstream import ET, register_stanza_plugin
-from sleekxmpp.xmlstream import ElementBase, StanzaBase
+from sleekxmpp.xmlstream import ET
+from sleekxmpp.xmlstream import ElementBase
from sleekxmpp.xmlstream.tostring import tostring
from sleekxmpp.xmlstream.matcher import StanzaPath, MatcherId
from sleekxmpp.xmlstream.matcher import MatchXMLMask, MatchXPath
diff --git a/sleekxmpp/thirdparty/socks.py b/sleekxmpp/thirdparty/socks.py
index a6c0d70e..9239a7b9 100644
--- a/sleekxmpp/thirdparty/socks.py
+++ b/sleekxmpp/thirdparty/socks.py
@@ -13,7 +13,7 @@ are permitted provided that the following conditions are met:
3. Neither the name of Dan Haim nor the names of his contributors may be used
to endorse or promote products derived from this software without specific
prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY DAN HAIM "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
@@ -28,9 +28,6 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMANGE.
This module provides a standard socket-like interface for Python
for tunneling connections through SOCKS proxies.
-"""
-
-"""
Minor modifications made by Christopher Gilbert (http://motomastyle.com/)
for use in PyLoris (http://pyloris.sourceforge.net/)
@@ -42,7 +39,6 @@ mainly to merge bug fixes found in Sourceforge
import socket
import struct
-import sys
PROXY_TYPE_SOCKS4 = 1
PROXY_TYPE_SOCKS5 = 2
diff --git a/sleekxmpp/thirdparty/statemachine.py b/sleekxmpp/thirdparty/statemachine.py
index 4b5ecd6b..113320fa 100644
--- a/sleekxmpp/thirdparty/statemachine.py
+++ b/sleekxmpp/thirdparty/statemachine.py
@@ -15,7 +15,8 @@ log = logging.getLogger(__name__)
class StateMachine(object):
- def __init__(self, states=[]):
+ def __init__(self, states=None):
+ if not states: states = []
self.lock = threading.Condition()
self.__states = []
self.addStates(states)
diff --git a/sleekxmpp/util/stringprep_profiles.py b/sleekxmpp/util/stringprep_profiles.py
index 54793343..84326bc3 100644
--- a/sleekxmpp/util/stringprep_profiles.py
+++ b/sleekxmpp/util/stringprep_profiles.py
@@ -16,7 +16,6 @@
from __future__ import unicode_literals
-import sys
import stringprep
from unicodedata import ucd_3_2_0 as unicodedata