Esempio n. 1
0
 def iterkeys(self):
     """Iterate for every key in an abstract database object."""
     if not tc.adb_iterinit(self.db):
         self._raise('Error initializing the iterator of an abstract ' \
                         'database object.')
     while True:
         key = tc.adb_iternext2(self.db)
         if not key:
             break
         yield key.value
Esempio n. 2
0
 def iterkeys(self):
     """Iterate for every key in an abstract database object."""
     if not tc.adb_iterinit(self.db):
         self._raise('Error initializing the iterator of an abstract ' \
                         'database object.')
     while True:
         key = tc.adb_iternext2(self.db)
         if not key:
             break
         yield key.value
Esempio n. 3
0
 def iterkeys(self, as_type=None):
     """Iterate for every key in an abstract database object."""
     if not tc.adb_iterinit(self.db):
         self._raise('Error initializing the iterator of an abstract ' \
                         'database object.')
     while True:
         c_key, c_key_len = tc.adb_iternext(self.db)
         if not c_key:
             break
         key = util.deserialize(c_key, c_key_len, as_type)
         yield key
Esempio n. 4
0
 def iterkeys(self, as_type=None):
     """Iterate for every key in an abstract database object."""
     if not tc.adb_iterinit(self.db):
         self._raise('Error initializing the iterator of an abstract ' \
                         'database object.')
     while True:
         c_key, c_key_len = tc.adb_iternext(self.db)
         if not c_key:
             break
         key = util.deserialize(c_key, c_key_len, as_type)
         yield key
Esempio n. 5
0
 def iteritems(self):
     """Iterate for every key / value in an abstract database
     object."""
     if not tc.adb_iterinit(self.db):
         self._raise('Error initializing the iterator of an abstract ' \
                         'database object.')
     while True:
         key = tc.adb_iternext2(self.db)
         if not key:
             break
         value = tc.adb_get2(self.db, key)
         yield (key.value, value.value)
Esempio n. 6
0
 def iteritems(self):
     """Iterate for every key / value in an abstract database
     object."""
     if not tc.adb_iterinit(self.db):
         self._raise('Error initializing the iterator of an abstract ' \
                         'database object.')
     while True:
         key = tc.adb_iternext2(self.db)
         if not key:
             break
         value = tc.adb_get2(self.db, key)
         yield (key.value, value.value)
Esempio n. 7
0
 def iteritems(self, key_type=None, value_type=None):
     """Iterate for every key / value in an abstract database
     object."""
     if not tc.adb_iterinit(self.db):
         self._raise('Error initializing the iterator of an abstract ' \
                         'database object.')
     while True:
         c_key, c_key_len = tc.adb_iternext(self.db)
         if not c_key:
             break
         (c_value, c_value_len) = tc.adb_get(self.db, c_key, c_key_len)
         key = util.deserialize(c_key, c_key_len, key_type)
         value = util.deserialize(c_value, c_value_len, value_type)
         yield (key, value)
Esempio n. 8
0
 def iteritems(self, key_type=None, value_type=None):
     """Iterate for every key / value in an abstract database
     object."""
     if not tc.adb_iterinit(self.db):
         self._raise('Error initializing the iterator of an abstract ' \
                         'database object.')
     while True:
         c_key, c_key_len = tc.adb_iternext(self.db)
         if not c_key:
             break
         (c_value, c_value_len) = tc.adb_get(self.db, c_key, c_key_len)
         key = util.deserialize(c_key, c_key_len, key_type)
         value = util.deserialize(c_value, c_value_len, value_type)
         yield (key, value)