Commit 3e87ee7b authored by Andreas Jung's avatar Andreas Jung

finally exterminated string module

parent be258da0
...@@ -12,13 +12,12 @@ ...@@ -12,13 +12,12 @@
############################################################################## ##############################################################################
__doc__='''short description __doc__='''short description
$Id: Undo.py,v 1.29 2002/02/08 17:16:57 matt Exp $''' $Id: Undo.py,v 1.30 2002/02/08 18:58:23 andreasjung Exp $'''
__version__='$Revision: 1.29 $'[11:-2] __version__='$Revision: 1.30 $'[11:-2]
import Globals, ExtensionClass import Globals, ExtensionClass
from DateTime import DateTime from DateTime import DateTime
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
from string import join
import base64 import base64
class UndoSupport(ExtensionClass.Base): class UndoSupport(ExtensionClass.Base):
...@@ -81,13 +80,13 @@ class UndoSupport(ExtensionClass.Base): ...@@ -81,13 +80,13 @@ class UndoSupport(ExtensionClass.Base):
# is defined. # is defined.
user = getSecurityManager().getUser() user = getSecurityManager().getUser()
if hasattr(user, 'aq_parent'): if hasattr(user, 'aq_parent'):
path = join(user.aq_parent.getPhysicalPath()[1:-1], '/') path = '/'.join(user.aq_parent.getPhysicalPath()[1:-1])
else: else:
path='' path=''
if path: spec['user_name']=Prefix(path) if path: spec['user_name']=Prefix(path)
# We also only want to undo things done here # We also only want to undo things done here
opath=join(self.getPhysicalPath(),'/') opath='/'.join(self.getPhysicalPath())
if opath: spec['description']=Prefix(opath) if opath: spec['description']=Prefix(opath)
r=Globals.UndoManager.undoInfo( r=Globals.UndoManager.undoInfo(
...@@ -101,7 +100,7 @@ class UndoSupport(ExtensionClass.Base): ...@@ -101,7 +100,7 @@ class UndoSupport(ExtensionClass.Base):
if desc: if desc:
desc = desc.split() desc = desc.split()
d1=desc[0] d1=desc[0]
desc = join(desc[1:]) 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) tid = "%s %s %s %s" % (encode64(tid), t, d1, desc)
else: else:
...@@ -118,7 +117,7 @@ class UndoSupport(ExtensionClass.Base): ...@@ -118,7 +117,7 @@ class UndoSupport(ExtensionClass.Base):
for tid in transaction_info: for tid in transaction_info:
tid=tid.split() tid=tid.split()
if tid: if tid:
get_transaction().note("Undo %s" % join(tid[1:])) get_transaction().note("Undo %s" % ''.join(tid[1:]))
tid=decode64(tid[0]) tid=decode64(tid[0])
undo(tid) undo(tid)
...@@ -153,7 +152,7 @@ def encode64(s, b2a=binascii.b2a_base64): ...@@ -153,7 +152,7 @@ def encode64(s, b2a=binascii.b2a_base64):
r=[]; a=r.append r=[]; a=r.append
for i in range(0, len(s), 57): for i in range(0, len(s), 57):
a(b2a(s[i:i+57])[:-1]) a(b2a(s[i:i+57])[:-1])
return join(r,'') return ''.join(r)
def decode64(s, a2b=binascii.a2b_base64): def decode64(s, a2b=binascii.a2b_base64):
__traceback_info__=len(s), `s` __traceback_info__=len(s), `s`
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment