[Checkins] SVN: relstorage/trunk/relstorage/ PPP (PeP8/Pyflakes)

Maurits van Rees m.van.rees at zestsoftware.nl
Fri Jan 7 12:08:35 EST 2011


Log message for revision 119445:
  PPP (PeP8/Pyflakes)

Changed:
  U   relstorage/trunk/relstorage/adapters/schema.py
  U   relstorage/trunk/relstorage/storage.py
  U   relstorage/trunk/relstorage/zodbconvert.py

-=-
Modified: relstorage/trunk/relstorage/adapters/schema.py
===================================================================
--- relstorage/trunk/relstorage/adapters/schema.py	2011-01-07 17:03:14 UTC (rev 119444)
+++ relstorage/trunk/relstorage/adapters/schema.py	2011-01-07 17:08:34 UTC (rev 119445)
@@ -18,7 +18,6 @@
 from ZODB.POSException import StorageError
 from zope.interface import implements
 import re
-import time
 
 relstorage_op_version = '1.5'
 log = logging.getLogger("relstorage")

Modified: relstorage/trunk/relstorage/storage.py
===================================================================
--- relstorage/trunk/relstorage/storage.py	2011-01-07 17:03:14 UTC (rev 119444)
+++ relstorage/trunk/relstorage/storage.py	2011-01-07 17:08:34 UTC (rev 119445)
@@ -34,7 +34,6 @@
 import cPickle
 import logging
 import os
-import sys
 import tempfile
 import threading
 import time
@@ -81,8 +80,8 @@
     """Storage to a relational database, based on invalidation polling"""
     implements(*_relstorage_interfaces)
 
-    _transaction=None # Transaction that is being committed
-    _tstatus=' '      # Transaction status, used for copying data
+    _transaction = None  # Transaction that is being committed
+    _tstatus = ' '  # Transaction status, used for copying data
     _is_read_only = False
 
     # load_conn and load_cursor are open most of the time.
@@ -370,7 +369,7 @@
         return self._adapter.stats.get_db_size()
 
     def registerDB(self, db, limit=None):
-        pass # we don't care
+        pass  # we don't care
 
     def isReadOnly(self):
         return self._is_read_only
@@ -540,7 +539,6 @@
         finally:
             self._lock_release()
 
-
     def store(self, oid, serial, data, version, transaction):
         if self._is_read_only:
             raise POSException.ReadOnlyError()
@@ -575,7 +573,6 @@
         finally:
             self._lock_release()
 
-
     def restore(self, oid, serial, data, version, prev_txn, transaction):
         # Like store(), but used for importing transactions.  See the
         # comments in FileStorage.restore().  The prev_txn optimization
@@ -605,7 +602,6 @@
         finally:
             self._lock_release()
 
-
     def checkCurrentSerialInTransaction(self, oid, serial, transaction):
         if transaction is not self._transaction:
             raise POSException.StorageTransactionError(self, transaction)
@@ -626,7 +622,6 @@
                     oid=oid, serials=(previous_serial, serial))
         self._txn_check_serials[oid] = serial
 
-
     def tpc_begin(self, transaction, tid=None, status=' '):
         if self._is_read_only:
             raise POSException.ReadOnlyError()
@@ -710,7 +705,6 @@
         adapter.txncontrol.add_transaction(cursor, tid_int, user, desc, ext)
         self._tid = tid
 
-
     def _clear_temp(self):
         # Clear all attributes used for transaction commit.
         # It is assumed that self._lock_acquire was called before this
@@ -727,7 +721,6 @@
         if blobhelper is not None:
             blobhelper.clear_temp()
 
-
     def _finish_store(self):
         """Move stored objects from the temporary table to final storage.
 
@@ -783,7 +776,6 @@
 
         return serials
 
-
     def tpc_vote(self, transaction):
         self._lock_acquire()
         try:
@@ -850,7 +842,6 @@
 
         return serials
 
-
     def tpc_finish(self, transaction, f=None):
         self._lock_acquire()
         try:
@@ -872,7 +863,6 @@
         finally:
             self._lock_release()
 
-
     def _finish(self, tid, user, desc, ext):
         """Commit the transaction."""
         # It is assumed that self._lock_acquire was called before this
@@ -890,7 +880,6 @@
         # including cache updates.
         self._ltid = self._tid
 
-
     def tpc_abort(self, transaction):
         self._lock_acquire()
         try:
@@ -1020,7 +1009,6 @@
         finally:
             self._lock_release()
 
-
     def undo(self, transaction_id, transaction):
         """Undo a transaction identified by transaction_id.
 
@@ -1076,7 +1064,7 @@
         if self._is_read_only:
             raise POSException.ReadOnlyError()
 
-        pack_point = repr(TimeStamp(*time.gmtime(t)[:5]+(t%60,)))
+        pack_point = repr(TimeStamp(*time.gmtime(t)[:5] + (t % 60,)))
         pack_point_int = u64(pack_point)
 
         def get_references(state):

Modified: relstorage/trunk/relstorage/zodbconvert.py
===================================================================
--- relstorage/trunk/relstorage/zodbconvert.py	2011-01-07 17:03:14 UTC (rev 119444)
+++ relstorage/trunk/relstorage/zodbconvert.py	2011-01-07 17:08:34 UTC (rev 119445)
@@ -23,7 +23,6 @@
 from StringIO import StringIO
 import sys
 import ZConfig
-from ZODB.utils import oid_repr
 
 schema_xml = """
 <schema>
@@ -113,9 +112,9 @@
         source.close()
         destination.close()
 
-        rate = (size/float(1024*1024)) / elapsed
-        log.info('All %d transactions copied successfully in %4.1f minutes at %1.3fmB/s.',
-                 num_txns, elapsed/60, rate)
+        rate = (size / float(1024 * 1024)) / elapsed
+        log.info("All %d transactions copied successfully in %4.1f minutes "
+                 "at %1.3fmB/s.", num_txns, elapsed / 60, rate)
 
 
 if __name__ == '__main__':



More information about the checkins mailing list