[Checkins] SVN: tempstorage/trunk/src/tempstorage/TemporaryStorage.py More PEP8 cleanup

Hanno Schlichting hannosch at hannosch.eu
Sat Sep 25 09:13:34 EDT 2010


Log message for revision 116901:
  More PEP8 cleanup
  

Changed:
  U   tempstorage/trunk/src/tempstorage/TemporaryStorage.py

-=-
Modified: tempstorage/trunk/src/tempstorage/TemporaryStorage.py
===================================================================
--- tempstorage/trunk/src/tempstorage/TemporaryStorage.py	2010-09-25 13:12:30 UTC (rev 116900)
+++ tempstorage/trunk/src/tempstorage/TemporaryStorage.py	2010-09-25 13:13:33 UTC (rev 116901)
@@ -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'):
@@ -92,7 +94,7 @@
         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
 
@@ -165,7 +167,7 @@
 
     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!
         """
@@ -218,7 +220,7 @@
 
         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(
@@ -285,8 +287,7 @@
                         # 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
@@ -359,8 +360,7 @@
             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



More information about the checkins mailing list