summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/tdb.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-24 11:02:52 -0600
committerStefan Metzmacher <metze@samba.org>2007-12-26 11:57:04 -0600
commit59efa6e5d074f9f0fbc0b5fd2b5bcdc9d78b95e3 (patch)
tree2569ef771a66ee66e1b57672c4d475a083789d59 /source4/lib/tdb/tdb.py
parenta822a14d1ec7e2635c3d004cc7488e4fd27b8d16 (diff)
downloadsamba-59efa6e5d074f9f0fbc0b5fd2b5bcdc9d78b95e3.tar.gz
samba-59efa6e5d074f9f0fbc0b5fd2b5bcdc9d78b95e3.tar.bz2
samba-59efa6e5d074f9f0fbc0b5fd2b5bcdc9d78b95e3.zip
r26585: Fix samba3.python tests.
(This used to be commit 231ec0777b7d1fb1297e3a974871b8735a386cfa)
Diffstat (limited to 'source4/lib/tdb/tdb.py')
-rw-r--r--source4/lib/tdb/tdb.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/lib/tdb/tdb.py b/source4/lib/tdb/tdb.py
index d4cf9f5c6f..8566397ed3 100644
--- a/source4/lib/tdb/tdb.py
+++ b/source4/lib/tdb/tdb.py
@@ -108,6 +108,20 @@ class tdb(object):
def has_key(self, key):
return self.exists(key) != 0
+ def fetch_uint32(self, key):
+ data = self.fetch(key)
+ if data is None:
+ return None
+ import struct
+ return struct.unpack("<L", data)[0]
+
+ def fetch_int32(self, key):
+ data = self.fetch(key)
+ if data is None:
+ return None
+ import struct
+ return struct.unpack("<l", data)[0]
+
class TdbIterator:
def __init__(self, tdb):