[Checkins] SVN: mongopersist/trunk/src/mongopersist/ pep8, typos, minor whatnots

Adam Groszer cvs-admin at zope.org
Tue Mar 5 10:52:53 UTC 2013


Log message for revision 130030:
  pep8, typos, minor whatnots

Changed:
  U   mongopersist/trunk/src/mongopersist/README.txt
  U   mongopersist/trunk/src/mongopersist/conflict.py
  U   mongopersist/trunk/src/mongopersist/datamanager.py
  U   mongopersist/trunk/src/mongopersist/pool.py
  U   mongopersist/trunk/src/mongopersist/pymongo.py
  U   mongopersist/trunk/src/mongopersist/serialize.py
  U   mongopersist/trunk/src/mongopersist/zope/interfaces.py

-=-
Modified: mongopersist/trunk/src/mongopersist/README.txt
===================================================================
--- mongopersist/trunk/src/mongopersist/README.txt	2013-03-04 18:54:54 UTC (rev 130029)
+++ mongopersist/trunk/src/mongopersist/README.txt	2013-03-05 10:52:52 UTC (rev 130030)
@@ -153,7 +153,7 @@
 ----------------------
 
 As you can see, even the reference looks nice and uses the standard Mongo DB
-reference construct. But what about arbitrary non-persistent, but pickable,
+reference construct. But what about arbitrary non-persistent, but picklable,
 objects? Well, let's create a phone number object for that:
 
   >>> class Phone(object):

Modified: mongopersist/trunk/src/mongopersist/conflict.py
===================================================================
--- mongopersist/trunk/src/mongopersist/conflict.py	2013-03-04 18:54:54 UTC (rev 130029)
+++ mongopersist/trunk/src/mongopersist/conflict.py	2013-03-05 10:52:52 UTC (rev 130030)
@@ -15,8 +15,9 @@
 from __future__ import absolute_import
 import struct
 import zope.interface
-from mongopersist import interfaces, serialize
+from mongopersist import interfaces
 
+
 def p64(v):
     """Pack an integer or long into a 8-byte string"""
     return struct.pack(">Q", v)

Modified: mongopersist/trunk/src/mongopersist/datamanager.py
===================================================================
--- mongopersist/trunk/src/mongopersist/datamanager.py	2013-03-04 18:54:54 UTC (rev 130029)
+++ mongopersist/trunk/src/mongopersist/datamanager.py	2013-03-05 10:52:52 UTC (rev 130030)
@@ -72,7 +72,7 @@
 
     # these are here to be easily patched
     ADD_TB = True
-    TB_LIMIT = 10 # 10 should be sufficient to figure
+    TB_LIMIT = 10  # 10 should be sufficient to figure
 
     def __init__(self, collection, function):
         self.collection = collection
@@ -131,7 +131,7 @@
 
     def __getattr__(self, name):
         attr = getattr(self.collection, name)
-        if MONGO_ACCESS_LOGGING  and name in self.LOGGED_METHODS:
+        if MONGO_ACCESS_LOGGING and name in self.LOGGED_METHODS:
             attr = LoggingDecorator(self.collection, attr)
         if name in self.QUERY_METHODS:
             attr = FlushDecorator(self._datamanager, attr)

Modified: mongopersist/trunk/src/mongopersist/pool.py
===================================================================
--- mongopersist/trunk/src/mongopersist/pool.py	2013-03-04 18:54:54 UTC (rev 130029)
+++ mongopersist/trunk/src/mongopersist/pool.py	2013-03-05 10:52:52 UTC (rev 130030)
@@ -36,7 +36,7 @@
     _mongoConnectionFactory = pymongo.MongoClient
 
     def __init__(self, host='localhost', port=27017, logLevel=20,
-        tz_aware=True, w=1, j=True, connectionFactory=None):
+                 tz_aware=True, w=1, j=True, connectionFactory=None):
         self.host = host
         self.port = port
         self.key = 'mongopersist-%s-%s' %(self.host, self.port)
@@ -85,7 +85,7 @@
     def get(self):
         try:
             dm = LOCAL.data_manager
-        except AttributeError, err:
+        except AttributeError:
             conn = self.pool.connection
             dm = LOCAL.data_manager = datamanager.MongoDataManager(
                 conn, **self.dm_kwargs)

Modified: mongopersist/trunk/src/mongopersist/pymongo.py
===================================================================
--- mongopersist/trunk/src/mongopersist/pymongo.py	2013-03-04 18:54:54 UTC (rev 130029)
+++ mongopersist/trunk/src/mongopersist/pymongo.py	2013-03-05 10:52:52 UTC (rev 130030)
@@ -13,9 +13,8 @@
 ##############################################################################
 """PyMongo Patches"""
 from __future__ import absolute_import
-from bson.son import SON
-from copy import deepcopy
 
+
 def DBRef__init__(self, collection, id, database=None, _extra=None):
     self._DBRef__collection = collection
     self._DBRef__id = id

Modified: mongopersist/trunk/src/mongopersist/serialize.py
===================================================================
--- mongopersist/trunk/src/mongopersist/serialize.py	2013-03-04 18:54:54 UTC (rev 130029)
+++ mongopersist/trunk/src/mongopersist/serialize.py	2013-03-05 10:52:52 UTC (rev 130030)
@@ -474,8 +474,10 @@
             if serializer.can_read(state):
                 return serializer.read(state)
 
-        if isinstance(state, dict) and ('_py_factory' in state or \
-               '_py_type' in state or '_py_persistent_type' in state):
+        if isinstance(state, dict) and (
+            '_py_factory' in state
+            or '_py_type' in state
+            or '_py_persistent_type' in state):
             # Load a non-persistent object.
             return self.get_non_persistent_object(state, obj)
         if isinstance(state, (tuple, list)):

Modified: mongopersist/trunk/src/mongopersist/zope/interfaces.py
===================================================================
--- mongopersist/trunk/src/mongopersist/zope/interfaces.py	2013-03-04 18:54:54 UTC (rev 130029)
+++ mongopersist/trunk/src/mongopersist/zope/interfaces.py	2013-03-05 10:52:52 UTC (rev 130030)
@@ -20,7 +20,7 @@
     _m_database = zope.schema.ASCIILine(
         title=u'Mongo Database',
         description=(
-            u'Specifies the MDB in which to store items. If ``None``, the '
+            u'Specifies the Mongo DB in which to store items. If ``None``, the '
             u'default database will be used.'),
         default=None)
 



More information about the checkins mailing list