Exemple #1
0
 def test_values(self):
     self.store['max'] = 3
     self.store['min'] = 6
     self.store['pow'] = 7
     self.store.sync()
     slist = list(values(self.store))
     self.assertEqual(6 in slist, True)
Exemple #2
0
 def test_values(self):
     self.store['max'] = 3
     self.store['min'] = 6
     self.store['pow'] = 7
     self.store.sync()
     slist = list(values(self.store))
     self.assertEqual(6 in slist, True)
 def values(self):
     loads = self.loads
     try:
         self._store.execute("SELECT svalues(data) as v FROM shove")
         for v in values(self._store.fetchall()["v"]):
             yield loads(v)
     except psycopg2.ProgrammingError:
         self._conn.rollback()
Exemple #4
0
 def __getattr__(self, key, _getter=object.__getattribute__):
     try:
         return self[key]
     except KeyError:
         if key == 'iteritems':
             return items(self)
         elif key == 'iterkeys':
             return keys(self)
         elif key == 'itervalues':
             return values(self)
         return _getter(self, key)
Exemple #5
0
 def __getattr__(self, key, _getter=object.__getattribute__):
     try:
         if key == 'iteritems':
             return items(self)
         elif key == 'iterkeys':
             return keys(self)
         elif key == 'itervalues':
             return values(self)
         return _getter(self, key)
     except AttributeError:
         return self[key]