Commit b81a3ea7 authored by Yann Leboulanger's avatar Yann Leboulanger

[NooN8] make all classes inherit from object

parent 5b3707eb
......@@ -493,8 +493,7 @@ def get_rand_number():
return rndg.getrandbits(50)
class AckChecker():
class AckChecker(object):
"""
Class for generating rids and generating and checking acknowledgements in
BOSH messages
......@@ -537,10 +536,7 @@ class AckChecker():
return self.rid
class KeyStack():
class KeyStack(object):
"""
Class implementing key sequences for BOSH messages
"""
......
......@@ -29,7 +29,7 @@ import logging
log = logging.getLogger('nbxmpp.client_nb')
class NonBlockingClient:
class NonBlockingClient(object):
"""
Client class is XMPP connection mountpoint. Objects for authentication,
network communication, roster, xml parsing ... are plugged to client object.
......
......@@ -43,7 +43,7 @@ DEFAULT_TIMEOUT_SECONDS = 25
XML_DECLARATION = '<?xml version=\'1.0\'?>'
# FIXME: ugly
class Dispatcher():
class Dispatcher(object):
"""
Why is this here - I needed to redefine Dispatcher for BOSH and easiest way
was to inherit original Dispatcher (now renamed to XMPPDispatcher). Trouble
......
......@@ -76,7 +76,7 @@ def get_idlequeue():
return SelectIdleQueue()
class IdleObject:
class IdleObject(object):
"""
Idle listener interface. Listed methods are called by IdleQueue.
"""
......@@ -216,7 +216,7 @@ class IdleCommand(IdleObject):
self._return_result()
class IdleQueue:
class IdleQueue(object):
"""
IdleQueue provide three distinct time based features. Uses select.poll()
......
......@@ -21,7 +21,8 @@ Provides PlugIn class functionality to develop extentions for xmpppy
import logging
log = logging.getLogger('nbxmpp.plugin')
class PlugIn:
class PlugIn(object):
"""
Abstract xmpppy plugin infrastructure code, providing plugging in/out and
debugging functionality
......
......@@ -605,7 +605,8 @@ stream_exceptions = {'bad-format': BadFormat,
'unsupported-version': UnsupportedVersion,
'xml-not-well-formed': XMLNotWellFormed}
class JID:
class JID(object):
"""
JID can be built from string, modified, compared, serialised into string
"""
......
......@@ -27,7 +27,8 @@ from base64 import b64encode
import logging
log = logging.getLogger('nbxmpp.proxy_connectors')
class ProxyConnector:
class ProxyConnector(object):
"""
Interface for proxy-connecting object - when tunnneling XMPP over proxies,
some connecting process usually has to be done before opening stream. Proxy
......
......@@ -485,7 +485,8 @@ class Node(object):
return self.NT
raise AttributeError
class T:
class T(object):
"""
Auxiliary class used to quick access to node's child nodes
"""
......@@ -519,7 +520,8 @@ class NT(T):
else:
return self.node.addChild(attr, payload=[val])
class NodeBuilder:
class NodeBuilder(object):
"""
Builds a Node class minidom from data parsed to it. This class used for two
purposes:
......
......@@ -3,14 +3,15 @@ from .protocol import NS_STREAM_MGMT
import logging
log = logging.getLogger('nbxmpp.smacks')
class Smacks():
'''
class Smacks(object):
"""
This is Smacks is the Stream Management class. It takes care of requesting
and sending acks. Also, it keeps track of the unhandled outgoing stanzas.
The dispatcher has to be able to access this class to increment the
number of handled stanzas
'''
"""
def __init__(self, con):
self.con = con # Connection object
......
......@@ -25,7 +25,8 @@ import stringprep
import unicodedata
from encodings import idna
class ILookupTable:
class ILookupTable(object):
"""
Interface for character lookup classes
"""
......@@ -36,7 +37,8 @@ class ILookupTable:
"""
pass
class IMappingTable:
class IMappingTable(object):
"""
Interface for character mapping classes
"""
......@@ -47,15 +49,15 @@ class IMappingTable:
"""
pass
class LookupTableFromFunction:
class LookupTableFromFunction(object):
__implements__ = ILookupTable
def __init__(self, in_table_function):
self.lookup = in_table_function
class LookupTable:
class LookupTable(object):
__implements__ = ILookupTable
def __init__(self, table):
......@@ -64,15 +66,15 @@ class LookupTable:
def lookup(self, c):
return c in self._table
class MappingTableFromFunction:
class MappingTableFromFunction(object):
__implements__ = IMappingTable
def __init__(self, map_table_function):
self.map = map_table_function
class EmptyMappingTable:
class EmptyMappingTable(object):
__implements__ = IMappingTable
def __init__(self, in_table_function):
......@@ -149,7 +151,7 @@ class Profile:
raise UnicodeError("Violation of BIDI Requirement 3")
class NamePrep:
class NamePrep(object):
"""
Implements preparation of internationalized domain names
......
......@@ -56,7 +56,7 @@ def gattr(obj, attr, default=None):
return default
class SSLWrapper:
class SSLWrapper(object):
"""
Abstract SSLWrapper base class
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment