[Zodb-checkins] CVS: ZODB3/ZODB - BaseStorage.py:1.22
Barry Warsaw
barry@wooz.org
Mon, 9 Sep 2002 18:39:39 -0400
Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv13463/ZODB
Modified Files:
BaseStorage.py
Log Message:
Clean up some whitespace, but not all.
tpc_begin(): Get rid of the apply() call since I believe we can now
rely on extended-call syntax being available.
=== ZODB3/ZODB/BaseStorage.py 1.21 => 1.22 ===
--- ZODB3/ZODB/BaseStorage.py:1.21 Wed Aug 28 13:04:16 2002
+++ ZODB3/ZODB/BaseStorage.py Mon Sep 9 18:39:38 2002
@@ -108,12 +108,14 @@
def tpc_abort(self, transaction):
self._lock_acquire()
try:
- if transaction is not self._transaction: return
+ if transaction is not self._transaction:
+ return
self._abort()
self._clear_temp()
- self._transaction=None
+ self._transaction = None
self._commit_lock_release()
- finally: self._lock_release()
+ finally:
+ self._lock_release()
def _abort(self):
"""Subclasses should redefine this to supply abort actions"""
@@ -122,34 +124,36 @@
def tpc_begin(self, transaction, tid=None, status=' '):
self._lock_acquire()
try:
- if self._transaction is transaction: return
+ if self._transaction is transaction:
+ return
self._lock_release()
self._commit_lock_acquire()
self._lock_acquire()
- self._transaction=transaction
+ self._transaction = transaction
self._clear_temp()
- user=transaction.user
- desc=transaction.description
- ext=transaction._extension
- if ext: ext=dumps(ext,1)
- else: ext=""
- self._ude=user, desc, ext
+ user = transaction.user
+ desc = transaction.description
+ ext = transaction._extension
+ if ext:
+ ext = dumps(ext,1)
+ else:
+ ext=""
+ self._ude = user, desc, ext
if tid is None:
- t=time.time()
- t=apply(TimeStamp,(time.gmtime(t)[:5]+(t%60,)))
- self._ts=t=t.laterThan(self._ts)
- self._serial=`t`
+ now = time.time()
+ t = TimeStamp(*(time.gmtime(now)[:5] + (now % 60,)))
+ self._ts = t = t.laterThan(self._ts)
+ self._serial = `t`
else:
- self._ts=TimeStamp(tid)
- self._serial=tid
-
- self._tstatus=status
+ self._ts = TimeStamp(tid)
+ self._serial = tid
+ self._tstatus = status
self._begin(self._serial, user, desc, ext)
-
- finally: self._lock_release()
+ finally:
+ self._lock_release()
def _begin(self, tid, u, d, e):
"""Subclasses should redefine this to supply transaction start actions.
@@ -159,7 +163,8 @@
def tpc_vote(self, transaction):
self._lock_acquire()
try:
- if transaction is not self._transaction: return
+ if transaction is not self._transaction:
+ return
self._vote()
finally:
self._lock_release()
@@ -172,16 +177,17 @@
def tpc_finish(self, transaction, f=None):
self._lock_acquire()
try:
- if transaction is not self._transaction: return
+ if transaction is not self._transaction:
+ return
try:
- if f is not None: f()
-
- u,d,e=self._ude
+ if f is not None:
+ f()
+ u, d, e = self._ude
self._finish(self._serial, u, d, e)
self._clear_temp()
finally:
- self._ude=None
- self._transaction=None
+ self._ude = None
+ self._transaction = None
self._commit_lock_release()
finally:
self._lock_release()