Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zodbtools
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
Kirill Smelkov
zodbtools
Commits
b1552049
Commit
b1552049
authored
Apr 28, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
bac7f527
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
zodbtools/util.py
zodbtools/util.py
+3
-1
zodbtools/zodbdump.py
zodbtools/zodbdump.py
+3
-2
No files found.
zodbtools/util.py
View file @
b1552049
...
...
@@ -26,10 +26,12 @@ from six.moves.urllib_parse import urlsplit, urlunsplit
from
zlib
import
crc32
,
adler32
from
ZODB.TimeStamp
import
TimeStamp
import
dateparser
from
golang
import
b
def
ashex
(
s
):
# type: (bytes) -> bytes
return
codecs
.
encode
(
s
,
'hex'
)
#return codecs.encode(s, 'hex')
return
b
(
codecs
.
encode
(
s
,
'hex'
))
# XXX ok?
def
fromhex
(
s
):
# type: (Union[str,bytes]) -> bytes
...
...
zodbtools/zodbdump.py
View file @
b1552049
...
...
@@ -492,9 +492,10 @@ class ObjectCopy(Object):
# ObjectData represents record with object data.
class
ObjectData
(
Object
):
# .data HashOnly | bytes
# .hashfunc bytes
hash function used for integrity
# .hashfunc bytes
XXX
hash function used for integrity
# .hash_ bytes hash of the object's data
def
__init__
(
self
,
oid
,
data
,
hashfunc
,
hash_
):
#assert isinstance(hashfunc, bytes)
super
(
ObjectData
,
self
).
__init__
(
oid
)
self
.
data
=
data
self
.
hashfunc
=
hashfunc
...
...
@@ -507,7 +508,7 @@ class ObjectData(Object):
size
=
data
.
size
else
:
size
=
len
(
data
)
z
=
b'obj %s %d %s:%s'
%
(
ashex
(
self
.
oid
),
size
,
self
.
hashfunc
,
ashex
(
self
.
hash_
))
z
=
b'obj %s %d %s:%s'
%
(
ashex
(
self
.
oid
),
size
,
b
(
self
.
hashfunc
)
,
ashex
(
self
.
hash_
))
if
hashonly
:
z
+=
b' -'
else
:
...
...
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