Commit 4eb9c4f7 authored by Nicolas Dumazet's avatar Nicolas Dumazet

maintaining "index" is not needed. -1 does the trick


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35046 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 80341ff9
......@@ -389,20 +389,18 @@ class Signature(Folder, SyncCode, File):
chunk = list()
chunk.append(self.partial_xml.data)
size = chunk[0].count('\n')
index = 0
current = next = self.partial_xml.next
while size < size_lines:
current = next
size += current.data.count('\n')
chunk.append(current.data)
index += 1
next = current.next
if size == size_lines:
self.partial_xml = next
elif size > size_lines:
data_list = chunk[index].split('\n')
chunk[index] = '\n'.join(data_list[:size_lines])
data_list = chunk[-1].split('\n')
chunk[-1] = '\n'.join(data_list[:size_lines])
if current is not None:
current.data = '\n'.join(data_list[size_lines:])
self.partial_xml = current
......
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