[thorstenp] replace ` with repr
This commit is contained in:
parent
2ffad66473
commit
00543277e4
|
@ -49,7 +49,7 @@ class Dispatcher(PlugIn):
|
||||||
def getAnID(self):
|
def getAnID(self):
|
||||||
global ID
|
global ID
|
||||||
ID+=1
|
ID+=1
|
||||||
return `ID`
|
return repr(ID)
|
||||||
|
|
||||||
def dumpHandlers(self):
|
def dumpHandlers(self):
|
||||||
""" Return set of user-registered callbacks in it's internal format.
|
""" Return set of user-registered callbacks in it's internal format.
|
||||||
|
@ -359,7 +359,7 @@ class Dispatcher(PlugIn):
|
||||||
elif not stanza.getID():
|
elif not stanza.getID():
|
||||||
global ID
|
global ID
|
||||||
ID+=1
|
ID+=1
|
||||||
_ID=`ID`
|
_ID=repr(ID)
|
||||||
stanza.setID(_ID)
|
stanza.setID(_ID)
|
||||||
else: _ID=stanza.getID()
|
else: _ID=stanza.getID()
|
||||||
if self._owner._registered_name and not stanza.getAttr('from'): stanza.setAttr('from',self._owner._registered_name)
|
if self._owner._registered_name and not stanza.getAttr('from'): stanza.setAttr('from',self._owner._registered_name)
|
||||||
|
|
|
@ -53,7 +53,7 @@ class Dispatcher(PlugIn):
|
||||||
def getAnID(self):
|
def getAnID(self):
|
||||||
global ID
|
global ID
|
||||||
ID += 1
|
ID += 1
|
||||||
return `ID`
|
return repr(ID)
|
||||||
|
|
||||||
def dumpHandlers(self):
|
def dumpHandlers(self):
|
||||||
''' Return set of user-registered callbacks in it's internal format.
|
''' Return set of user-registered callbacks in it's internal format.
|
||||||
|
@ -411,7 +411,7 @@ class Dispatcher(PlugIn):
|
||||||
elif not stanza.getID():
|
elif not stanza.getID():
|
||||||
global ID
|
global ID
|
||||||
ID+=1
|
ID+=1
|
||||||
_ID=`ID`
|
_ID=repr(ID)
|
||||||
stanza.setID(_ID)
|
stanza.setID(_ID)
|
||||||
else:
|
else:
|
||||||
_ID=stanza.getID()
|
_ID=stanza.getID()
|
||||||
|
|
|
@ -85,7 +85,7 @@ class Session:
|
||||||
self.DEBUG=owner.Dispatcher.DEBUG
|
self.DEBUG=owner.Dispatcher.DEBUG
|
||||||
self._expected={}
|
self._expected={}
|
||||||
self._owner=owner
|
self._owner=owner
|
||||||
if self.TYP=='server': self.ID=`random.random()`[2:]
|
if self.TYP=='server': self.ID=repr(random.random())[2:]
|
||||||
else: self.ID=None
|
else: self.ID=None
|
||||||
|
|
||||||
self.sendbuffer=''
|
self.sendbuffer=''
|
||||||
|
@ -128,7 +128,7 @@ class Session:
|
||||||
except: received = ''
|
except: received = ''
|
||||||
|
|
||||||
if len(received): # length of 0 means disconnect
|
if len(received): # length of 0 means disconnect
|
||||||
self.DEBUG(`self.fileno()`+' '+received,'got')
|
self.DEBUG(repr(self.fileno())+' '+received,'got')
|
||||||
else:
|
else:
|
||||||
self.DEBUG('Socket error while receiving data','error')
|
self.DEBUG('Socket error while receiving data','error')
|
||||||
self.set_socket_state(SOCKET_DEAD)
|
self.set_socket_state(SOCKET_DEAD)
|
||||||
|
@ -189,7 +189,7 @@ class Session:
|
||||||
self.set_socket_state(SOCKET_DEAD)
|
self.set_socket_state(SOCKET_DEAD)
|
||||||
self.DEBUG("Socket error while sending data",'error')
|
self.DEBUG("Socket error while sending data",'error')
|
||||||
return self.terminate_stream()
|
return self.terminate_stream()
|
||||||
self.DEBUG(`self.fileno()`+' '+self.sendbuffer[:sent],'sent')
|
self.DEBUG(repr(self.fileno())+' '+self.sendbuffer[:sent],'sent')
|
||||||
self._stream_pos_sent+=sent
|
self._stream_pos_sent+=sent
|
||||||
self.sendbuffer=self.sendbuffer[sent:]
|
self.sendbuffer=self.sendbuffer[sent:]
|
||||||
self._stream_pos_delivered=self._stream_pos_sent # Should be acquired from socket somehow. Take SSL into account.
|
self._stream_pos_delivered=self._stream_pos_sent # Should be acquired from socket somehow. Take SSL into account.
|
||||||
|
|
|
@ -363,7 +363,7 @@ class NodeBuilder:
|
||||||
"""XML Parser callback. Used internally"""
|
"""XML Parser callback. Used internally"""
|
||||||
self.check_data_buffer()
|
self.check_data_buffer()
|
||||||
self._inc_depth()
|
self._inc_depth()
|
||||||
self.DEBUG(DBG_NODEBUILDER, "DEPTH -> %i , tag -> %s, attrs -> %s" % (self.__depth, tag, `attrs`), 'down')
|
self.DEBUG(DBG_NODEBUILDER, "DEPTH -> %i , tag -> %s, attrs -> %s" % (self.__depth, tag, repr(attrs)), 'down')
|
||||||
if self.__depth == self._dispatch_depth:
|
if self.__depth == self._dispatch_depth:
|
||||||
if not self._mini_dom :
|
if not self._mini_dom :
|
||||||
self._mini_dom = Node(tag=tag, attrs=attrs, nsp = self._document_nsp, node_built=True)
|
self._mini_dom = Node(tag=tag, attrs=attrs, nsp = self._document_nsp, node_built=True)
|
||||||
|
|
|
@ -103,7 +103,7 @@ class TCPsocket(PlugIn):
|
||||||
self._sock.connect(ai[4])
|
self._sock.connect(ai[4])
|
||||||
self._send=self._sock.sendall
|
self._send=self._sock.sendall
|
||||||
self._recv=self._sock.recv
|
self._recv=self._sock.recv
|
||||||
self.DEBUG("Successfully connected to remote host %s"%`server`,'start')
|
self.DEBUG("Successfully connected to remote host %s"%repr(server),'start')
|
||||||
return 'ok'
|
return 'ok'
|
||||||
except: continue
|
except: continue
|
||||||
except: pass
|
except: pass
|
||||||
|
|
Loading…
Reference in New Issue