Commit db0f8473 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Don't shadow built-ins.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@958 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 7b3d9eea
......@@ -51,8 +51,8 @@ class Dispatcher:
class Application(object):
"""The storage node application."""
def __init__(self, file, section):
config = ConfigurationManager(file, section)
def __init__(self, filename, section):
config = ConfigurationManager(filename, section)
self.name = config.getName()
logging.debug('the name is %s', self.name)
......
......@@ -176,12 +176,12 @@ class ThreadContext(object):
_threads_dict = {}
def __getThreadData(self):
id = get_ident()
thread_id = get_ident()
try:
result = self._threads_dict[id]
result = self._threads_dict[thread_id
except KeyError:
self.clear(id)
result = self._threads_dict[id]
self.clear(thread_id)
result = self._threads_dict[thread_id]
return result
def __getattr__(self, name):
......@@ -195,10 +195,10 @@ class ThreadContext(object):
thread_data = self.__getThreadData()
thread_data[name] = value
def clear(self, id=None):
if id is None:
id = get_ident()
self._threads_dict[id] = {
def clear(self, thread_id=None):
if thread_id is None:
thread_id = get_ident()
self._threads_dict[thread_id] = {
'tid': None,
'txn': None,
'data_dict': {},
......@@ -215,8 +215,8 @@ class Application(object):
def __init__(self, master_nodes, name, connector, **kw):
# XXX: use a configuration entry
from neo import buildFormatString
format = buildFormatString('CLIENT')
logging.basicConfig(level=logging.DEBUG, format=format)
fmt = buildFormatString('CLIENT')
logging.basicConfig(level=logging.DEBUG, format=fmt)
em = EventManager()
# Start polling thread
self.poll_thread = ThreadedPoll(em)
......
......@@ -56,8 +56,8 @@ if VERBOSE_LOCKING:
self.waiting = []
self._note('%s@%X created by %r', self.__class__.__name__, id(self), LockUser(1))
def _note(self, format, *args):
sys.stderr.write(format % args + '\n')
def _note(self, fmt, *args):
sys.stderr.write(fmt % args + '\n')
sys.stderr.flush()
def _getOwner(self):
......
......@@ -41,9 +41,9 @@ from neo.connector import getConnectorHandler
class Application(object):
"""The master node application."""
def __init__(self, file, section):
def __init__(self, filename, section):
config = ConfigurationManager(file, section)
config = ConfigurationManager(filename, section)
self.connector_handler = getConnectorHandler(config.getConnector())
self.name = config.getName()
......
......@@ -416,8 +416,8 @@ class Packet(object):
def getId(self):
return self._id
def setId(self, id):
self._id = id
def setId(self, packet_id):
self._id = packet_id
def getType(self):
return self._type
......@@ -494,11 +494,11 @@ def _checkNodeState(state):
raise PacketMalformedError('invalid node state %d' % state)
return node_state
def _checkNodeType(type):
node_type = node_types.get(type)
def _checkNodeType(node_type):
_node_type = node_types.get(node_type)
if node_type is None:
raise PacketMalformedError('invalid node type %d' % type)
return node_type
raise PacketMalformedError('invalid node type %d' % node_type)
return _node_type
def _checkAddress(address):
if address == '\0' * 6:
......@@ -531,13 +531,13 @@ def _encodePTID(ptid):
return INVALID_PTID
return ptid
def _readString(buffer, name, offset=0):
buffer = buffer[offset:]
(size, ) = unpack('!L', buffer[:4])
string = buffer[4:4+size]
def _readString(buf, name, offset=0):
buf = buf[offset:]
(size, ) = unpack('!L', buf[:4])
string = buf[4:4+size]
if len(string) != size:
raise PacketMalformedError("can't read string <%s>" % name)
return (string, buffer[offset+size:])
return (string, buf[offset+size:])
# packet decoding
@handle_errors
......
......@@ -39,8 +39,8 @@ from neo.bootstrap import BootstrapManager
class Application(object):
"""The storage node application."""
def __init__(self, file, section, reset = False):
config = ConfigurationManager(file, section)
def __init__(self, filename, section, reset=False):
config = ConfigurationManager(filename, section)
self.name = config.getName()
logging.debug('the name is %s', self.name)
......
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