Exemplo n.º 1
0
Arquivo: core.py Projeto: lcrees/shove
 def __delitem__(self, key):
     try:
         self.sync()
     except AttributeError:
         pass
     exhaustmap(methodcaller("__delitem__", key), self._stores)
     try:
         del self._cache[key]
     except KeyError:
         pass
Exemplo n.º 2
0
 def __delitem__(self, key):
     try:
         self.sync()
     except AttributeError:
         pass
     exhaustmap(methodcaller('__delitem__', key), self._stores)
     try:
         del self._cache[key]
     except KeyError:
         pass
Exemplo n.º 3
0
Arquivo: core.py Projeto: lcrees/shove
 def sync(self):
     """Writes buffer to stores."""
     exhaustmap(methodcaller("update", self._buffer), self._stores)
     self._buffer.clear()
Exemplo n.º 4
0
 def sync(self):
     '''Writes buffer to stores.'''
     exhaustmap(methodcaller('update', self._buffer), self._stores)
     self._buffer.clear()
Exemplo n.º 5
0
 def test_exhaustmap(self):
     from stuf import exhaustmap
     deferred = exhaustmap(lambda x: x + x, iter([1, 2, 3]), StopIteration)
     self.assertIsNone(deferred)
Exemplo n.º 6
0
 def sync(self):
     '''Writes buffer to stores.'''
     exhaustmap(methodcaller('update', self._buffer), self._stores)
     self._buffer.clear()