Log message for revision 110490:
  Style fixes

Changed:
  U   Zope/branches/2.12/src/App/Undo.py

-=-
Modified: Zope/branches/2.12/src/App/Undo.py
===================================================================
--- Zope/branches/2.12/src/App/Undo.py  2010-04-05 15:36:12 UTC (rev 110489)
+++ Zope/branches/2.12/src/App/Undo.py  2010-04-05 15:48:04 UTC (rev 110490)
@@ -15,7 +15,6 @@
 $Id$
 """
 
-from Acquisition import aq_base
 from Acquisition import aq_inner
 from Acquisition import aq_parent
 from AccessControl import getSecurityManager
@@ -30,6 +29,7 @@
 from ZopeUndo.Prefix import Prefix
 from zope.interface import implements
 
+
 class UndoSupport(ExtensionClass.Base):
 
     implements(IUndoSupport)
@@ -37,8 +37,8 @@
     security = ClassSecurityInfo()
 
     manage_options=(
-        {'label':'Undo', 'action':'manage_UndoForm',
-         'help':('OFSP','Undo.stx')},
+        {'label': 'Undo', 'action': 'manage_UndoForm',
+         'help': ('OFSP', 'Undo.stx')},
         )
 
     security.declareProtected(undo_changes, 'manage_UndoForm')
@@ -47,20 +47,25 @@
         globals(),
         PrincipiaUndoBatchSize=20,
         first_transaction=0,
-        last_transaction=20
+        last_transaction=20,
         )
 
     def get_request_var_or_attr(self, name, default):
         if hasattr(self, 'REQUEST'):
             REQUEST=self.REQUEST
-            if REQUEST.has_key(name): return REQUEST[name]
-            if hasattr(self, name): v=getattr(self, name)
-            else: v=default
-            REQUEST[name]=v
+            if REQUEST.has_key(name):
+                return REQUEST[name]
+            if hasattr(self, name):
+                v = getattr(self, name)
+            else:
+                v = default
+            REQUEST[name] = v
             return v
         else:
-            if hasattr(self, name): v=getattr(self, name)
-            else: v=default
+            if hasattr(self, name):
+                v = getattr(self, name)
+            else:
+                v = default
             return v
 
     security.declareProtected(undo_changes, 'undoable_transactions')
@@ -90,37 +95,39 @@
         if hasattr(user, 'aq_parent'):
             path = '/'.join(user.aq_parent.getPhysicalPath()[1:-1])
         else:
-            path=''
-        if path: spec['user_name']=Prefix(path)
+            path = ''
+        if path:
+            spec['user_name'] = Prefix(path)
 
         if getattr(aq_parent(aq_inner(self)), '_p_jar', None) == self._p_jar:
             # We only want to undo things done here (and not in mounted
             # databases)
-            opath='/'.join(self.getPhysicalPath())
+            opath = '/'.join(self.getPhysicalPath())
         else:
             # Special case: at the root of a database,
             # allow undo of any path.
             opath = None
-        if opath: spec['description']=Prefix(opath)
+        if opath:
+            spec['description'] = Prefix(opath)
 
         r = self._p_jar.db().undoInfo(
             first_transaction, last_transaction, spec)
 
         for d in r:
-            d['time']=t=DateTime(d['time'])
+            d['time'] = t = DateTime(d['time'])
             desc = d['description']
-            tid=d['id']
+            tid = d['id']
             if desc:
                 desc = desc.split()
-                d1=desc[0]
+                d1 = desc[0]
                 desc = ''.join(desc[1:])
-                if len(desc) > 60: desc = desc[:56]+' ...'
+                if len(desc) > 60:
+                    desc = desc[:56] + ' ...'
                 tid = "%s %s %s %s" % (encode64(tid), t, d1, desc)
             else:
                 tid = "%s %s" % (encode64(tid), t)
-            d['id']=tid
+            d['id'] = tid
 
-
         return r
 
     security.declareProtected(undo_changes, 'manage_undo_transactions')
@@ -136,7 +143,8 @@
                 tid=decode64(tid[0])
                 undo(tid)
 
-        if REQUEST is None: return
+        if REQUEST is None:
+            return
         REQUEST['RESPONSE'].redirect("%s/manage_UndoForm" % REQUEST['URL1'])
         return ''
 
@@ -147,13 +155,17 @@
 
 import binascii
 
+
 def encode64(s, b2a=binascii.b2a_base64):
-    if len(s) < 58: return b2a(s)
-    r=[]; a=r.append
+    if len(s) < 58:
+        return b2a(s)
+    r = []
+    a = r.append
     for i in range(0, len(s), 57):
         a(b2a(s[i:i+57])[:-1])
     return ''.join(r)
 
+
 def decode64(s, a2b=binascii.a2b_base64):
     __traceback_info__=len(s), `s`
     return a2b(s+'\n')

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
https://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to