repo.or.cz
/
Samba
/
gbeck.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
s3:net_rpc: don't shutdown a cli_state passed from the caller
[Samba/gbeck.git]
/
lib
/
tdb
/
python
/
tdbdump.py
blob
d759d771c872661db207a161be7624b06577de4f
1
#!/usr/bin/python
2
# Trivial reimplementation of tdbdump in Python
3
4
import
tdb
,
sys
5
6
if
len
(
sys
.
argv
) <
2
:
7
print
"Usage: tdbdump.py <tdb-file>"
8
sys
.
exit
(
1
)
9
10
db
=
tdb
.
Tdb
(
sys
.
argv
[
1
])
11
for
(
k
,
v
)
in
db
.
iteritems
():
12
print
"{
\n
key(
%d
) =
%r
\n
data(
%d
) =
%r
\n
}"
% (
len
(
k
),
k
,
len
(
v
),
v
)