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

Anonymize unused loop variable with an underscore.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1900 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent bd014457
...@@ -311,7 +311,7 @@ if __name__ == '__main__': ...@@ -311,7 +311,7 @@ if __name__ == '__main__':
for i in xrange(10): for i in xrange(10):
cache[i] = str(i) cache[i] = str(i)
for j in xrange(1000): for _ in xrange(1000):
for i in xrange(10): for i in xrange(10):
assert cache.get(i) == str(i), '%d does not exist' % i assert cache.get(i) == str(i), '%d does not exist' % i
......
...@@ -53,7 +53,7 @@ class PartitionTable(neo.pt.PartitionTable): ...@@ -53,7 +53,7 @@ class PartitionTable(neo.pt.PartitionTable):
index = 0 index = 0
for offset in xrange(self.np): for offset in xrange(self.np):
row = [] row = []
for i in xrange(repeats): for _ in xrange(repeats):
node = node_list[index] node = node_list[index]
row.append(neo.pt.Cell(node)) row.append(neo.pt.Cell(node))
self.count_dict[node] = self.count_dict.get(node, 0) + 1 self.count_dict[node] = self.count_dict.get(node, 0) + 1
......
...@@ -405,7 +405,7 @@ class AnswerPrimary(Packet): ...@@ -405,7 +405,7 @@ class AnswerPrimary(Packet):
known_master_list = [] known_master_list = []
list_entry_len = self._list_entry_len list_entry_len = self._list_entry_len
list_entry_format = self._list_entry_format list_entry_format = self._list_entry_format
for i in xrange(n): for _ in xrange(n):
next_packet_offset = packet_offset + list_entry_len next_packet_offset = packet_offset + list_entry_len
address, uuid = unpack(list_entry_format, address, uuid = unpack(list_entry_format,
body[packet_offset:next_packet_offset]) body[packet_offset:next_packet_offset])
...@@ -476,7 +476,7 @@ class AskPartitionTable(Packet): ...@@ -476,7 +476,7 @@ class AskPartitionTable(Packet):
offset_list = [] offset_list = []
list_entry_len = self._list_entry_len list_entry_len = self._list_entry_len
list_entry_format = self._list_entry_format list_entry_format = self._list_entry_format
for i in xrange(n): for _ in xrange(n):
next_packet_offset = packet_offset + list_entry_len next_packet_offset = packet_offset + list_entry_len
offset = unpack(list_entry_format, offset = unpack(list_entry_format,
body[packet_offset:next_packet_offset])[0] body[packet_offset:next_packet_offset])[0]
...@@ -516,11 +516,11 @@ class AnswerPartitionTable(Packet): ...@@ -516,11 +516,11 @@ class AnswerPartitionTable(Packet):
row_entry_len = self._row_entry_len row_entry_len = self._row_entry_len
cell_entry_format = self._cell_entry_format cell_entry_format = self._cell_entry_format
cell_entry_len = self._cell_entry_len cell_entry_len = self._cell_entry_len
for i in xrange(n): for _ in xrange(n):
next_index = index + row_entry_len next_index = index + row_entry_len
offset, m = unpack(row_entry_format, body[index:next_index]) offset, m = unpack(row_entry_format, body[index:next_index])
index = next_index index = next_index
for j in xrange(m): for _ in xrange(m):
next_index = index + cell_entry_len next_index = index + cell_entry_len
uuid, state = unpack(cell_entry_format, body[index:next_index]) uuid, state = unpack(cell_entry_format, body[index:next_index])
index = next_index index = next_index
...@@ -563,11 +563,11 @@ class SendPartitionTable(Packet): ...@@ -563,11 +563,11 @@ class SendPartitionTable(Packet):
row_entry_len = self._row_entry_len row_entry_len = self._row_entry_len
cell_entry_format = self._cell_entry_format cell_entry_format = self._cell_entry_format
cell_entry_len = self._cell_entry_len cell_entry_len = self._cell_entry_len
for i in xrange(n): for _ in xrange(n):
next_index = index + row_entry_len next_index = index + row_entry_len
offset, m = unpack(row_entry_format, body[index:next_index]) offset, m = unpack(row_entry_format, body[index:next_index])
index = next_index index = next_index
for j in xrange(m): for _ in xrange(m):
next_index = index + cell_entry_len next_index = index + cell_entry_len
uuid, state = unpack(cell_entry_format, body[index:next_index]) uuid, state = unpack(cell_entry_format, body[index:next_index])
index = next_index index = next_index
...@@ -603,7 +603,7 @@ class NotifyPartitionChanges(Packet): ...@@ -603,7 +603,7 @@ class NotifyPartitionChanges(Packet):
cell_list = [] cell_list = []
list_entry_format = self._list_entry_format list_entry_format = self._list_entry_format
list_entry_len = self._list_entry_len list_entry_len = self._list_entry_len
for i in xrange(n): for _ in xrange(n):
next_packet_offset = packet_offset + list_entry_len next_packet_offset = packet_offset + list_entry_len
(offset, uuid, state) = unpack(list_entry_format, (offset, uuid, state) = unpack(list_entry_format,
body[packet_offset:next_packet_offset]) body[packet_offset:next_packet_offset])
...@@ -667,7 +667,7 @@ class AnswerUnfinishedTransactions(Packet): ...@@ -667,7 +667,7 @@ class AnswerUnfinishedTransactions(Packet):
tid_list = [] tid_list = []
list_entry_format = self._list_entry_format list_entry_format = self._list_entry_format
list_entry_len = self._list_entry_len list_entry_len = self._list_entry_len
for i in xrange(n): for _ in xrange(n):
next_offset = offset + list_entry_len next_offset = offset + list_entry_len
tid = unpack(list_entry_format, body[offset:next_offset])[0] tid = unpack(list_entry_format, body[offset:next_offset])[0]
offset = next_offset offset = next_offset
...@@ -754,7 +754,7 @@ class AskFinishTransaction(Packet): ...@@ -754,7 +754,7 @@ class AskFinishTransaction(Packet):
oid_list = [] oid_list = []
list_entry_format = self._list_entry_format list_entry_format = self._list_entry_format
list_entry_len = self._list_entry_len list_entry_len = self._list_entry_len
for i in xrange(n): for _ in xrange(n):
next_offset = offset + list_entry_len next_offset = offset + list_entry_len
oid = unpack(list_entry_format, body[offset:next_offset])[0] oid = unpack(list_entry_format, body[offset:next_offset])[0]
offset = next_offset offset = next_offset
...@@ -813,7 +813,7 @@ class InvalidateObjects(Packet): ...@@ -813,7 +813,7 @@ class InvalidateObjects(Packet):
oid_list = [] oid_list = []
list_entry_format = self._list_entry_format list_entry_format = self._list_entry_format
list_entry_len = self._list_entry_len list_entry_len = self._list_entry_len
for i in xrange(n): for _ in xrange(n):
next_offset = offset + list_entry_len next_offset = offset + list_entry_len
oid = unpack(list_entry_format, body[offset:next_offset])[0] oid = unpack(list_entry_format, body[offset:next_offset])[0]
offset = next_offset offset = next_offset
...@@ -862,7 +862,7 @@ class AnswerNewOIDs(Packet): ...@@ -862,7 +862,7 @@ class AnswerNewOIDs(Packet):
oid_list = [] oid_list = []
list_entry_format = self._list_entry_format list_entry_format = self._list_entry_format
list_entry_len = self._list_entry_len list_entry_len = self._list_entry_len
for i in xrange(n): for _ in xrange(n):
next_offset = offset + list_entry_len next_offset = offset + list_entry_len
oid = unpack(list_entry_format, body[offset:next_offset])[0] oid = unpack(list_entry_format, body[offset:next_offset])[0]
offset = next_offset offset = next_offset
...@@ -941,7 +941,7 @@ class AskStoreTransaction(Packet): ...@@ -941,7 +941,7 @@ class AskStoreTransaction(Packet):
ext = body[:ext_len] ext = body[:ext_len]
body = body[ext_len:] body = body[ext_len:]
oid_list = [] oid_list = []
for i in xrange(oid_len): for _ in xrange(oid_len):
(oid, ) = unpack('8s', body[:8]) (oid, ) = unpack('8s', body[:8])
body = body[8:] body = body[8:]
oid_list.append(oid) oid_list.append(oid)
...@@ -1034,7 +1034,7 @@ class AnswerTIDs(Packet): ...@@ -1034,7 +1034,7 @@ class AnswerTIDs(Packet):
tid_list = [] tid_list = []
list_entry_format = self._list_entry_format list_entry_format = self._list_entry_format
list_entry_len = self._list_entry_len list_entry_len = self._list_entry_len
for i in xrange(n): for _ in xrange(n):
next_offset = offset + list_entry_len next_offset = offset + list_entry_len
tid = unpack(list_entry_format, body[offset:next_offset])[0] tid = unpack(list_entry_format, body[offset:next_offset])[0]
offset = next_offset offset = next_offset
...@@ -1077,7 +1077,7 @@ class AnswerTransactionInformation(Packet): ...@@ -1077,7 +1077,7 @@ class AnswerTransactionInformation(Packet):
ext = body[:ext_len] ext = body[:ext_len]
body = body[ext_len:] body = body[ext_len:]
oid_list = [] oid_list = []
for i in xrange(oid_len): for _ in xrange(oid_len):
(oid, ) = unpack('8s', body[:8]) (oid, ) = unpack('8s', body[:8])
body = body[8:] body = body[8:]
oid_list.append(oid) oid_list.append(oid)
...@@ -1118,7 +1118,7 @@ class AnswerObjectHistory(Packet): ...@@ -1118,7 +1118,7 @@ class AnswerObjectHistory(Packet):
history_list = [] history_list = []
list_entry_format = self._list_entry_format list_entry_format = self._list_entry_format
list_entry_len = self._list_entry_len list_entry_len = self._list_entry_len
for i in xrange(length): for _ in xrange(length):
next_offset = offset + list_entry_len next_offset = offset + list_entry_len
serial, size = unpack(list_entry_format, body[offset:next_offset]) serial, size = unpack(list_entry_format, body[offset:next_offset])
offset = next_offset offset = next_offset
...@@ -1157,7 +1157,7 @@ class AnswerOIDs(Packet): ...@@ -1157,7 +1157,7 @@ class AnswerOIDs(Packet):
oid_list = [] oid_list = []
list_entry_format = self._list_entry_format list_entry_format = self._list_entry_format
list_entry_len = self._list_entry_len list_entry_len = self._list_entry_len
for i in xrange(n): for _ in xrange(n):
next_offset = offset + list_entry_len next_offset = offset + list_entry_len
oid = unpack(list_entry_format, body[offset:next_offset])[0] oid = unpack(list_entry_format, body[offset:next_offset])[0]
offset = next_offset offset = next_offset
...@@ -1213,11 +1213,11 @@ class AnswerPartitionList(Packet): ...@@ -1213,11 +1213,11 @@ class AnswerPartitionList(Packet):
row_entry_len = self._row_entry_len row_entry_len = self._row_entry_len
cell_entry_format = self._cell_entry_format cell_entry_format = self._cell_entry_format
cell_entry_len = self._cell_entry_len cell_entry_len = self._cell_entry_len
for i in xrange(n): for _ in xrange(n):
next_index = index + row_entry_len next_index = index + row_entry_len
offset, m = unpack(row_entry_format, body[index:next_index]) offset, m = unpack(row_entry_format, body[index:next_index])
index = next_index index = next_index
for j in xrange(m): for _ in xrange(m):
next_index = index + cell_entry_len next_index = index + cell_entry_len
uuid, state = unpack(cell_entry_format, body[index:next_index]) uuid, state = unpack(cell_entry_format, body[index:next_index])
index = next_index index = next_index
...@@ -1266,7 +1266,7 @@ class AnswerNodeList(Packet): ...@@ -1266,7 +1266,7 @@ class AnswerNodeList(Packet):
node_list = [] node_list = []
list_entry_format = self._list_entry_format list_entry_format = self._list_entry_format
list_entry_len = self._list_entry_len list_entry_len = self._list_entry_len
for i in xrange(n): for _ in xrange(n):
next_offset = offset + list_entry_len next_offset = offset + list_entry_len
r = unpack(list_entry_format, body[offset:next_offset]) r = unpack(list_entry_format, body[offset:next_offset])
offset = next_offset offset = next_offset
...@@ -1386,7 +1386,7 @@ class NotifyNodeInformation(Packet): ...@@ -1386,7 +1386,7 @@ class NotifyNodeInformation(Packet):
node_list = [] node_list = []
list_entry_format = self._list_entry_format list_entry_format = self._list_entry_format
list_entry_len = self._list_entry_len list_entry_len = self._list_entry_len
for i in xrange(n): for _ in xrange(n):
next_offset = offset + list_entry_len next_offset = offset + list_entry_len
r = unpack(list_entry_format, body[offset:next_offset]) r = unpack(list_entry_format, body[offset:next_offset])
offset = next_offset offset = next_offset
......
...@@ -77,7 +77,7 @@ class PartitionTable(object): ...@@ -77,7 +77,7 @@ class PartitionTable(object):
# Note: don't use [[]] * num_partition construct, as it duplicates # Note: don't use [[]] * num_partition construct, as it duplicates
# instance *references*, so the outer list contains really just one # instance *references*, so the outer list contains really just one
# inner list instance. # inner list instance.
self.partition_list = [[] for x in xrange(num_partitions)] self.partition_list = [[] for _ in xrange(num_partitions)]
self.count_dict = {} self.count_dict = {}
def getID(self): def getID(self):
...@@ -96,7 +96,7 @@ class PartitionTable(object): ...@@ -96,7 +96,7 @@ class PartitionTable(object):
# Note: don't use [[]] * self.np construct, as it duplicates # Note: don't use [[]] * self.np construct, as it duplicates
# instance *references*, so the outer list contains really just one # instance *references*, so the outer list contains really just one
# inner list instance. # inner list instance.
self.partition_list = [[] for x in xrange(self.np)] self.partition_list = [[] for _ in xrange(self.np)]
self.count_dict.clear() self.count_dict.clear()
def getAssignedPartitionList(self, uuid): def getAssignedPartitionList(self, uuid):
......
...@@ -270,7 +270,7 @@ class Application(object): ...@@ -270,7 +270,7 @@ class Application(object):
def executeQueuedEvents(self): def executeQueuedEvents(self):
l = len(self.event_queue) l = len(self.event_queue)
p = self.event_queue.popleft p = self.event_queue.popleft
for i in xrange(l): for _ in xrange(l):
some_callable, msg_id, conn, args, kwargs = p() some_callable, msg_id, conn, args, kwargs = p()
conn.setPeerId(msg_id) conn.setPeerId(msg_id)
some_callable(conn, *args, **kwargs) some_callable(conn, *args, **kwargs)
......
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