repo.or.cz
/
Samba.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
nss_wrapper: Align indentation with the rest of Samba
[Samba.git]
/
lib
/
tdb
/
python
/
tdbdump.py
blob
01859ebce267baa71edb52fba10bee081dd7c67c
1
#!/usr/bin/env 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
)