Commit b3db19e2 authored by Hanno Schlichting's avatar Hanno Schlichting

More PEP8 cleanup

parent 1a4fbe99
...@@ -43,18 +43,20 @@ LOG = getLogger('TemporaryStorage') ...@@ -43,18 +43,20 @@ LOG = getLogger('TemporaryStorage')
class ReferenceCountError(POSException.POSError): class ReferenceCountError(POSException.POSError):
""" Error while decrementing a reference to an object in the commit phase. """ Error while decrementing a reference to an object in the commit phase.
The object's reference count was below zero. The object's reference count was below zero.
""" """
class TemporaryStorageError(POSException.POSError): class TemporaryStorageError(POSException.POSError):
""" A Temporary Storage exception occurred. """ A Temporary Storage exception occurred.
This probably indicates that there is a low memory condition or a This probably indicates that there is a low memory condition or a
tempfile space shortage. Check available tempfile space and RAM tempfile space shortage. Check available tempfile space and RAM
consumption and restart the server process. consumption and restart the server process.
""" """
class TemporaryStorage(BaseStorage, ConflictResolvingStorage): class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
def __init__(self, name='TemporaryStorage'): def __init__(self, name='TemporaryStorage'):
...@@ -92,7 +94,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage): ...@@ -92,7 +94,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
self._tmp = [] self._tmp = []
self._conflict_cache = {} self._conflict_cache = {}
self._last_cache_gc = 0 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._oid = z64
self._ltid = z64 self._ltid = z64
...@@ -165,7 +167,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage): ...@@ -165,7 +167,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
def loadSerial(self, oid, serial, marker=[]): def loadSerial(self, oid, serial, marker=[]):
""" This is only useful to make conflict resolution work. """ This is only useful to make conflict resolution work.
It does not actually implement all the semantics that a revisioning It does not actually implement all the semantics that a revisioning
storage needs! storage needs!
""" """
...@@ -218,7 +220,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage): ...@@ -218,7 +220,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
self._lock_acquire() self._lock_acquire()
try: try:
if self._index.has_key(oid): if oid in self._index:
oserial = self._index[oid] oserial = self._index[oid]
if serial != oserial: if serial != oserial:
newdata = self.tryToResolveConflict( newdata = self.tryToResolveConflict(
...@@ -285,8 +287,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage): ...@@ -285,8 +287,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
# This should never happen # This should never happen
raise ReferenceCountError( raise ReferenceCountError(
"%s (Oid %r had refcount %s)" % "%s (Oid %r had refcount %s)" %
(ReferenceCountError.__doc__, roid, rc) (ReferenceCountError.__doc__, roid, rc))
)
referenceCount[roid] = rc referenceCount[roid] = rc
if rc == 0: if rc == 0:
zeros[roid] = 1 zeros[roid] = 1
...@@ -359,8 +360,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage): ...@@ -359,8 +360,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
elif rc < 0: elif rc < 0:
raise ReferenceCountError( raise ReferenceCountError(
"%s (Oid %r had refcount %s)" % "%s (Oid %r had refcount %s)" %
(ReferenceCountError.__doc__, roid, rc) (ReferenceCountError.__doc__, roid, rc))
)
else: else:
# DM 2005-01-07: decremented *before* the test! see above # DM 2005-01-07: decremented *before* the test! see above
#referenceCount[roid] = rc - 1 #referenceCount[roid] = rc - 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment