Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
preetwinder
erp5
Commits
7cbeac7a
Commit
7cbeac7a
authored
May 30, 2012
by
Vincent Pelletier
Committed by
Sebastien Robin
Aug 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop debugging prints.
parent
43a399f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
5 deletions
+0
-5
product/ERP5Type/BTreeData.py
product/ERP5Type/BTreeData.py
+0
-5
No files found.
product/ERP5Type/BTreeData.py
View file @
7cbeac7a
...
@@ -32,7 +32,6 @@ class BTreeData(Persistent):
...
@@ -32,7 +32,6 @@ class BTreeData(Persistent):
value_len
=
len
(
value
)
value_len
=
len
(
value
)
if
lower_key
+
value_len
>
offset
:
if
lower_key
+
value_len
>
offset
:
key
=
lower_key
key
=
lower_key
#print 'Overwriting', key + value_len - offset, 'bytes, copying', offset - key, 'bytes'
buf
=
value
[:
offset
-
key
]
+
buf
buf
=
value
[:
offset
-
key
]
+
buf
else
:
else
:
key
=
offset
key
=
offset
...
@@ -46,21 +45,18 @@ class BTreeData(Persistent):
...
@@ -46,21 +45,18 @@ class BTreeData(Persistent):
if
buf_offset
>=
actual_buf_len
:
if
buf_offset
>=
actual_buf_len
:
break
break
next_buf_offset
=
buf_offset
+
(
next_key
-
key
)
next_buf_offset
=
buf_offset
+
(
next_key
-
key
)
#print 'Offset', offset + buf_offset, 'in key', key, 'with len', next_key - key
to_apply
[
key
]
=
PersistentString
(
buf
[
buf_offset
:
next_buf_offset
])
to_apply
[
key
]
=
PersistentString
(
buf
[
buf_offset
:
next_buf_offset
])
buf_offset
=
next_buf_offset
buf_offset
=
next_buf_offset
key
=
next_key
key
=
next_key
else
:
else
:
to_add
=
buf
[
buf_offset
:]
to_add
=
buf
[
buf_offset
:]
if
to_add
:
if
to_add
:
#print 'Offset', offset + buf_offset, 'in own key with len', len(to_add)
tree
[
offset
+
buf_offset
]
=
PersistentString
(
to_add
)
tree
[
offset
+
buf_offset
]
=
PersistentString
(
to_add
)
for
key
,
value
in
to_apply
.
iteritems
():
for
key
,
value
in
to_apply
.
iteritems
():
tree
[
key
]
=
value
tree
[
key
]
=
value
return
buf_len
return
buf_len
def
read
(
self
,
offset
,
size
):
def
read
(
self
,
offset
,
size
):
#print 'read', hex(offset), hex(size)
start_offset
=
offset
start_offset
=
offset
# start_offset = offset = int(offset)
# start_offset = offset = int(offset)
# assert not isinstance(offset, long), 'Offset is too big for int ' \
# assert not isinstance(offset, long), 'Offset is too big for int ' \
...
@@ -78,7 +74,6 @@ class BTreeData(Persistent):
...
@@ -78,7 +74,6 @@ class BTreeData(Persistent):
offset
-=
key
offset
-=
key
written
=
0
written
=
0
for
key
in
iterator
:
for
key
in
iterator
:
#print 'key', hex(key)
padding
=
min
(
size
,
key
-
start_offset
-
written
)
padding
=
min
(
size
,
key
-
start_offset
-
written
)
if
padding
:
if
padding
:
write
(
'
\
x00
'
*
padding
)
write
(
'
\
x00
'
*
padding
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment