[Zope-Checkins] CVS: Zope/lib/python/ZClasses - Basic.py:1.20 Method.py:1.22 Property.py:1.34 ZClass.py:1.60
Andreas Jung
andreas@digicool.com
Thu, 7 Feb 2002 13:10:59 -0500
Update of /cvs-repository/Zope/lib/python/ZClasses
In directory cvs.zope.org:/tmp/cvs-serv26470
Modified Files:
Basic.py Method.py Property.py ZClass.py
Log Message:
replaced string module calls by string methods
=== Zope/lib/python/ZClasses/Basic.py 1.19 => 1.20 ===
import Globals, OFS.PropertySheets, OFS.Image, ExtensionClass
-from string import split, join, strip
import Acquisition, Products
class ZClassBasicSheet(OFS.PropertySheets.PropertySheet,
=== Zope/lib/python/ZClasses/Method.py 1.21 => 1.22 ===
import Acquisition, ExtensionClass, Globals, OFS.PropertySheets, OFS.Folder
from AccessControl.Permission import pname
-from string import strip
import App.Dialogs, ZClasses, App.Factory, App.Product, App.ProductRegistry
import ZClassOwner
from AccessControl.PermissionMapping import aqwrap, PermissionMapper
@@ -121,26 +120,26 @@
return id+' '
def _setOb(self, id, object):
- self.setClassAttr(strip(id), MWp(object))
+ self.setClassAttr(id.strip(), MWp(object))
def _delOb(self, id):
- self.delClassAttr(strip(id))
+ self.delClassAttr(id.strip())
def _delObject(self, id, dp=1):
# Ick! This is necessary to deal with spaces. Waaa!
object=self._getOb(id)
object.manage_beforeDelete(object, self)
- id=strip(id)
+ id=id.strip()
self._objects=tuple(filter(lambda i,n=id:
- strip(i['id']) != n,
+ i['id'].strip() != n,
self._objects))
self._delOb(id)
def _getOb(self, id, default=_marker):
if default is _marker:
- r=self.getClassAttr(strip(id))
+ r=self.getClassAttr(id.strip())
else:
- try: r=self.getClassAttr(strip(id))
+ try: r=self.getClassAttr(id.strip())
except: return default
if hasattr(r, methodattr):
@@ -157,7 +156,7 @@
m._permissionMapper=wrapper
mw=MWp(m)
- self.setClassAttr(strip(id), mw)
+ self.setClassAttr(id.strip(), mw)
r=m
=== Zope/lib/python/ZClasses/Property.py 1.33 => 1.34 ===
import OFS.PropertySheets, Globals, OFS.SimpleItem, OFS.PropertyManager
import Acquisition
-from string import join, upper
from AccessControl.Permission import pname
class ClassCaretaker:
@@ -89,7 +88,7 @@
a=r.append
for p in self.propertyMap():
pid=p['id']
- pid=upper(pid[:1])+pid[1:]
+ pid=pid[:1].upper()+pid[1:]
a(' <tr><th align=left valign=top>%s</th>' % pid)
a(' <td align=left valign=top>%s</td>' %
self._view_widget_for_type(p['type'], p['id'])
@@ -97,7 +96,7 @@
a(' </tr>')
a('</table>')
a('<dtml-var standard_html_footer>')
- r=join(r,'\n')
+ r='\n'.join(r)
self.aq_parent.aq_parent.methods.manage_addDTMLMethod(id, title, r)
if REQUEST is not None:
REQUEST['RESPONSE'].redirect(REQUEST['URL3']+'/methods/manage')
@@ -185,7 +184,7 @@
a(' </td></tr>')
a('</table></form>')
a('</body></html>')
- r=join(r,'\n')
+ r='\n'.join(r)
self.aq_parent.aq_parent.methods.manage_addDTMLMethod(id, title, r)
if REQUEST is not None:
REQUEST['RESPONSE'].redirect(REQUEST['URL3']+'/methods/manage')
=== Zope/lib/python/ZClasses/ZClass.py 1.59 => 1.60 ===
"""Zope Classes
"""
-import Globals, string, OFS.SimpleItem, OFS.PropertySheets, Products
+import Globals, OFS.SimpleItem, OFS.PropertySheets, Products
import Method, Basic, Property, AccessControl.Role, re
from ZPublisher.mapply import mapply
@@ -73,9 +73,9 @@
key = "%s/%s" % (base_module, base_name)
if base_module[:9] == 'Products.':
- base_module = string.split( base_module,'.' )[1]
+ base_module = base_module.split('.' )[1]
else:
- base_module = string.split( base_module,'.' )[0]
+ base_module = base_module.split('.' )[0]
info="%s: %s" % ( base_module, base_name )
@@ -331,7 +331,7 @@
id.update(self.absolute_url())
id.update(str(time.time()))
id=id.digest()
- id=string.strip(base64.encodestring(id))
+ id=base64.encodestring(id).strip()
return '*'+id