source:
vendor/3.5.0/lib/tdb/python/tdbdump.py
Last change on this file was 414, checked in by , 15 years ago | |
---|---|
File size: 291 bytes |
Line | |
---|---|
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 "{\nkey(%d) = %r\ndata(%d) = %r\n}" % (len(k), k, len(v), v) |
Note:
See TracBrowser
for help on using the repository browser.