[Zope3-checkins] CVS: Zope3/src/ZODB - Connection.py:1.146 serialize.py:1.13

Gintautas Miliauskas gintas at pov.lt
Fri Apr 9 07:11:34 EDT 2004


Update of /cvs-repository/Zope3/src/ZODB
In directory cvs.zope.org:/tmp/cvs-serv8199

Modified Files:
	Connection.py serialize.py 
Log Message:
Harmless stuff: fixed several typos and removed trailing whitespace in a few
places.


=== Zope3/src/ZODB/Connection.py 1.145 => 1.146 ===
--- Zope3/src/ZODB/Connection.py:1.145	Thu Apr  8 14:12:25 2004
+++ Zope3/src/ZODB/Connection.py	Fri Apr  9 07:11:32 2004
@@ -60,7 +60,7 @@
     Connection that loaded them.  When a transaction commits, it uses
     the Connection to store modified objects.
 
-    The typical use of ZODB is for each thread to have its own
+    Typical use of ZODB is for each thread to have its own
     Connection and that no thread should have more than one Connection
     to the same database.  A thread is associated with a Connection by
     loading objects from that Connection.  Objects loaded by one
@@ -168,7 +168,7 @@
         # the lock must be held when reading _invalidated.
 
         # XXX It sucks that we have to hold the lock to read
-        # _invalidated.  Normally, _invalidated is written by call
+        # _invalidated.  Normally, _invalidated is written by calling
         # dict.update, which will execute atomically by virtue of the
         # GIL.  But some storage might generate oids where hash or
         # compare invokes Python code.  In that case, the GIL can't
@@ -200,8 +200,8 @@
     def setLocalTransaction(self):
         """Use a transaction bound to the connection rather than the thread"""
 
-        # XXX mark this method as depcrecated?  note that it's
-        # signature changed?
+        # XXX mark this method as deprecated?
+        # Note that its signature has changed.
 
         if self._txn_mgr is transaction:
             self._txn_mgr = transaction.TransactionManager()
@@ -277,9 +277,9 @@
         """Add a new object 'obj' to the database and assign it an oid.
 
         A persistent object is normally added to the database and
-        assigned an oid when it becomes reachable an object already in
+        assigned an oid when it becomes reachable to an object already in
         the database.  In some cases, it is useful to create a new
-        object and uses its oid (_p_oid) in a single transaction.
+        object and use its oid (_p_oid) in a single transaction.
 
         This method assigns a new oid regardless of whether the object
         is reachable.
@@ -357,7 +357,7 @@
                                               self._db.classFactory)
 
     def _resetCache(self):
-        """Creates a new cache, discarding the old.
+        """Creates a new cache, discarding the old one.
 
         See the docstring for the resetCaches() function.
         """
@@ -509,9 +509,9 @@
             serial = getattr(obj, "_p_serial", z64)
 
             if serial == z64:
-                # new object
+                # obj is a new object
                 self._creating.append(oid)
-                # If this object was added, it is now in _creating, so can
+                # Because obj was added, it is now in _creating, so it can
                 # be removed from _added.
                 self._added.pop(oid, None)
             else:
@@ -528,7 +528,7 @@
             try:
                 self._cache[oid] = obj
             except:
-                # Dang, I bet its wrapped:
+                # Dang, I bet it's wrapped:
                 if hasattr(obj, 'aq_base'):
                     self._cache[oid] = obj.aq_base
                 else:
@@ -538,7 +538,7 @@
         self._added_during_commit = None
 
     def commit_sub(self, t):
-        """Commit all work done in all subtransactions for this transaction"""
+        """Commit all work done in all subtransactions for this transaction."""
         if self._tmp is None:
             return
         src = self._storage
@@ -559,7 +559,7 @@
             self._handle_serial(s, oid, change=False)
 
     def abort_sub(self, t):
-        """Abort work done in all subtransactions for this transaction"""
+        """Abort work done in all subtransactions for this transaction."""
         if self._tmp is None:
             return
         src = self._storage
@@ -708,6 +708,7 @@
         # There is a harmless data race with self._invalidated.  A
         # dict update could go on in another thread, but we don't care
         # because we have to check again after the load anyway.
+
         if (obj._p_oid in self._invalidated
             and not myhasattr(obj, "_p_independent")):
             # If the object has _p_independent(), we will handle it below.
@@ -787,7 +788,7 @@
     def oldstate(self, obj, tid):
         """Return copy of obj that was written by tid.
 
-        XXX The returned object does not have the typical metdata
+        XXX The returned object does not have the typical metadata
         (_p_jar, _p_oid, _p_serial) set.  I'm not sure how references
         to other peristent objects are handled.
 
@@ -899,12 +900,12 @@
             del obj._p_changed # transition from changed to ghost
         else:
             if change:
-                obj._p_changed = 0 # trans. from changed to uptodate
+                obj._p_changed = 0 # transition from changed to up-to-date
             obj._p_serial = serial
 
     def tpc_finish(self, transaction):
-        # It's important that the storage call the function we pass
-        # while it still has it's lock.  We don't want another thread
+        # It's important that the storage calls the function we pass
+        # while it still has its lock.  We don't want another thread
         # to be able to read any updated data until we've had a chance
         # to send an invalidation message to all of the other
         # connections!
@@ -939,10 +940,10 @@
     def setDebugInfo(self, *args):
         self._debug_info = self._debug_info + args
 
-    def getTransferCounts(self, clear=0):
+    def getTransferCounts(self, clear=False):
         """Returns the number of objects loaded and stored.
 
-        Set the clear argument to reset the counters.
+        If clear is True, reset the counters.
         """
         res = self._load_count, self._store_count
         if clear:


=== Zope3/src/ZODB/serialize.py 1.12 => 1.13 ===
--- Zope3/src/ZODB/serialize.py:1.12	Thu Feb 26 17:55:51 2004
+++ Zope3/src/ZODB/serialize.py	Fri Apr  9 07:11:32 2004
@@ -154,7 +154,7 @@
         >>> bob._p_jar is jar
         True
 
-        If the object already has a persistent id, it is not changed:
+        If the object already has a persistent id, the id is not changed:
 
         >>> bob._p_oid = 24
         >>> oid, cls = writer.persistent_id(bob)
@@ -173,7 +173,7 @@
                """foreign database connection
 
         Constructor arguments used by __new__(), as returned by
-        __getnewargs__(), can affect memory allocation, but also may
+        __getnewargs__(), can affect memory allocation, but may also
         change over the life of the object.  This makes it useless to
         cache even the object's class.
 
@@ -210,7 +210,7 @@
             # Not persistent, pickle normally
             return None
 
-        # Any persistent object mosy have an oid:
+        # Any persistent object must have an oid:
         try:
             oid = obj._p_oid
         except AttributeError:
@@ -237,10 +237,10 @@
                     if oid is None:
                         # Here we are causing the object to be saved in
                         # the database. One could argue that we shouldn't
-                        # do this, because a wekref should not cause an object
+                        # do this, because a weakref should not cause an object
                         # to be added.  We'll be optimistic, though, and
                         # assume that the object will be added eventually.
-                        
+
                         oid = self._jar.new_oid()
                         obj._p_jar = self._jar
                         obj._p_oid = oid
@@ -275,7 +275,7 @@
 
     def serialize(self, obj):
         # We don't use __class__ here, because obj could be a persistent proxy.
-        # We don't want to be folled by proxies.
+        # We don't want to be fooled by proxies.
         klass = type(obj)
 
         newargs = getattr(obj, "__getnewargs__", None)
@@ -375,7 +375,7 @@
             if args is None:
                 args = ()
         else:
-            # Definately new style direct class reference
+            # Definitely new style direct class reference
             args = ()
 
         if issubclass(klass, Broken):
@@ -527,7 +527,7 @@
     #   tuples, so that we wrap oids that are lists or tuples in
     #   tuples.
     #
-    # - oids may *not* be false.  I'm not sure why. 
+    # - oids may *not* be False.  I'm not sure why. 
 
     out = []
     for v in rootl:




More information about the Zope3-Checkins mailing list