Random bits in xmpp. Cosmetic only.

This commit is contained in:
Stephan Erb 2008-12-27 11:45:58 +00:00
parent b7400724b7
commit 233848aec0
5 changed files with 13 additions and 7 deletions

View File

@ -58,7 +58,7 @@ class NonBlockingClient:
# the EventDispatcher
self._caller = caller
self._owner = self
self._registered_name = None
self._registered_name = None # our full jid, set after successful auth
self.connected = ''
self.socket = None
self.on_connect = None

View File

@ -15,6 +15,10 @@
# $Id: features.py,v 1.22 2005/09/30 20:13:04 mikealbon Exp $
'''
Different stuff that wasn't worth separating it into modules
'''
from protocol import *
REGISTER_DATA_RECEIVED='REGISTER DATA RECEIVED'

View File

@ -15,8 +15,9 @@
# $Id: protocol.py,v 1.52 2006/01/09 22:08:57 normanr Exp $
'''
Protocol module contains tools that is needed for processing of
xmpp-related data structures.
Protocol module contains tools that are needed for processing of xmpp-related
data structures, including jabber-objects like JID or different stanzas and sub-
stanzas) handling routines.
'''
from simplexml import Node, NodeBuilder
@ -484,7 +485,7 @@ class Message(Protocol):
def buildReply(self,text=None):
''' Builds and returns another message object with specified text.
The to, from and thread properties of new message are pre-set as reply to this message. '''
m=Message(to=self.getFrom(),frm=self.getTo(),body=text,node=self)
m=Message(to=self.getFrom(),frm=self.getTo(),body=text)
th=self.getThread()
if th: m.setThread(th)
return m

View File

@ -214,7 +214,7 @@ class StdlibSSLWrapper(SSLWrapper):
raise SSLWrapper.Error(self.sock or self.sslobj, e)
return None
def send(self, data, flags=None, now = False):
def send(self, data, flags=None, now=False):
# we simply ignore flags since ssl object doesn't support it
try:
return self.sslobj.write(data)

View File

@ -20,7 +20,8 @@ Transports are objects responsible for connecting to XMPP server and putting
data to wrapped sockets in in desired form (SSL, TLS, TCP, for HTTP proxy,
for SOCKS5 proxy...)
Transports are not aware of XMPP stanzas.
Transports are not aware of XMPP stanzas and only responsible for low-level
connection handling.
'''
from simplexml import ustr
@ -404,7 +405,7 @@ class NonBlockingTCP(NonBlockingTransport, IdleObject):
def read_timeout(self):
log.info('read_timeout called, state == %s' % self.get_state())
if self.get_state()==CONNECTING:
if self.get_state() == CONNECTING:
# if read_timeout is called during connecting, connect() didn't end yet
# thus we have to call the tcp failure callback
self._on_connect_failure('Error during connect to %s:%s' %