summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/tdb.i
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2008-01-06 23:17:55 -0600
committerStefan Metzmacher <metze@samba.org>2008-01-06 17:21:02 -0600
commite45c7ffb800448c41ee0fd69e6ebd87446b116e5 (patch)
tree4b848308cace264b1aa28e43b8065108809d4bb3 /source4/lib/tdb/tdb.i
parent9d09a06920c2de8c6312f3c0a0280faee65fd432 (diff)
downloadsamba-e45c7ffb800448c41ee0fd69e6ebd87446b116e5.tar.gz
samba-e45c7ffb800448c41ee0fd69e6ebd87446b116e5.tar.bz2
samba-e45c7ffb800448c41ee0fd69e6ebd87446b116e5.zip
r26677: Implement and test iter{keys,values,items} for tdb bindings.
Use tempfile.mkstemp() instead of os.tmpnam() in tests. (This used to be commit 5c3c131d174ba0f162c210d3e6ca30f2ed2a3ec0)
Diffstat (limited to 'source4/lib/tdb/tdb.i')
-rw-r--r--source4/lib/tdb/tdb.i12
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/lib/tdb/tdb.i b/source4/lib/tdb/tdb.i
index 5e928941de..c82d2d0a6d 100644
--- a/source4/lib/tdb/tdb.i
+++ b/source4/lib/tdb/tdb.i
@@ -263,7 +263,17 @@ typedef struct tdb_context {
for k in iter(self):
del(self[k])
- # TODO: iterkeys, itervalues, iteritems
+ def iterkeys(self):
+ for k in iter(self):
+ yield k
+
+ def itervalues(self):
+ for k in iter(self):
+ yield self[k]
+
+ def iteritems(self):
+ for k in iter(self):
+ yield (k, self[k])
# TODO: any other missing methods for container types
}