[thorstenp] replace ` with repr

This commit is contained in:
Yann Leboulanger 2008-10-11 09:51:27 +00:00
parent 2ffad66473
commit 00543277e4
5 changed files with 9 additions and 9 deletions

View File

@ -49,7 +49,7 @@ class Dispatcher(PlugIn):
def getAnID(self):
global ID
ID+=1
return `ID`
return repr(ID)
def dumpHandlers(self):
""" Return set of user-registered callbacks in it's internal format.
@ -359,7 +359,7 @@ class Dispatcher(PlugIn):
elif not stanza.getID():
global ID
ID+=1
_ID=`ID`
_ID=repr(ID)
stanza.setID(_ID)
else: _ID=stanza.getID()
if self._owner._registered_name and not stanza.getAttr('from'): stanza.setAttr('from',self._owner._registered_name)

View File

@ -53,7 +53,7 @@ class Dispatcher(PlugIn):
def getAnID(self):
global ID
ID += 1
return `ID`
return repr(ID)
def dumpHandlers(self):
''' Return set of user-registered callbacks in it's internal format.
@ -411,7 +411,7 @@ class Dispatcher(PlugIn):
elif not stanza.getID():
global ID
ID+=1
_ID=`ID`
_ID=repr(ID)
stanza.setID(_ID)
else:
_ID=stanza.getID()

View File

@ -85,7 +85,7 @@ class Session:
self.DEBUG=owner.Dispatcher.DEBUG
self._expected={}
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
self.sendbuffer=''
@ -128,7 +128,7 @@ class Session:
except: received = ''
if len(received): # length of 0 means disconnect
self.DEBUG(`self.fileno()`+' '+received,'got')
self.DEBUG(repr(self.fileno())+' '+received,'got')
else:
self.DEBUG('Socket error while receiving data','error')
self.set_socket_state(SOCKET_DEAD)
@ -189,7 +189,7 @@ class Session:
self.set_socket_state(SOCKET_DEAD)
self.DEBUG("Socket error while sending data",'error')
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.sendbuffer=self.sendbuffer[sent:]
self._stream_pos_delivered=self._stream_pos_sent # Should be acquired from socket somehow. Take SSL into account.

View File

@ -363,7 +363,7 @@ class NodeBuilder:
"""XML Parser callback. Used internally"""
self.check_data_buffer()
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 not self._mini_dom :
self._mini_dom = Node(tag=tag, attrs=attrs, nsp = self._document_nsp, node_built=True)

View File

@ -103,7 +103,7 @@ class TCPsocket(PlugIn):
self._sock.connect(ai[4])
self._send=self._sock.sendall
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'
except: continue
except: pass