Skip to content

Commit

Permalink
More PEP8 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed Sep 25, 2010
1 parent 1a4fbe9 commit b3db19e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/tempstorage/TemporaryStorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,20 @@

class ReferenceCountError(POSException.POSError):
""" Error while decrementing a reference to an object in the commit phase.
The object's reference count was below zero.
"""


class TemporaryStorageError(POSException.POSError):
""" A Temporary Storage exception occurred.
This probably indicates that there is a low memory condition or a
tempfile space shortage. Check available tempfile space and RAM
consumption and restart the server process.
"""


class TemporaryStorage(BaseStorage, ConflictResolvingStorage):

def __init__(self, name='TemporaryStorage'):
Expand Down Expand Up @@ -92,7 +94,7 @@ def __init__(self, name='TemporaryStorage'):
self._tmp = []
self._conflict_cache = {}
self._last_cache_gc = 0
self._recently_gc_oids = [None for x in range (RECENTLY_GC_OIDS_LEN)]
self._recently_gc_oids = [None for x in range(RECENTLY_GC_OIDS_LEN)]
self._oid = z64
self._ltid = z64

Expand Down Expand Up @@ -165,7 +167,7 @@ def loadEx(self, oid, version):

def loadSerial(self, oid, serial, marker=[]):
""" This is only useful to make conflict resolution work.
It does not actually implement all the semantics that a revisioning
storage needs!
"""
Expand Down Expand Up @@ -218,7 +220,7 @@ def store(self, oid, serial, data, version, transaction):

self._lock_acquire()
try:
if self._index.has_key(oid):
if oid in self._index:
oserial = self._index[oid]
if serial != oserial:
newdata = self.tryToResolveConflict(
Expand Down Expand Up @@ -285,8 +287,7 @@ def _finish(self, tid, u, d, e):
# This should never happen
raise ReferenceCountError(
"%s (Oid %r had refcount %s)" %
(ReferenceCountError.__doc__, roid, rc)
)
(ReferenceCountError.__doc__, roid, rc))
referenceCount[roid] = rc
if rc == 0:
zeros[roid] = 1
Expand Down Expand Up @@ -359,8 +360,7 @@ def _takeOutGarbage(self, oid):
elif rc < 0:
raise ReferenceCountError(
"%s (Oid %r had refcount %s)" %
(ReferenceCountError.__doc__, roid, rc)
)
(ReferenceCountError.__doc__, roid, rc))
else:
# DM 2005-01-07: decremented *before* the test! see above
#referenceCount[roid] = rc - 1
Expand Down

0 comments on commit b3db19e

Please sign in to comment.