Commit c3fbdacf authored by Andreas Jung's avatar Andreas Jung

replaced string module calls by string methods

parent 149eb603
......@@ -27,7 +27,7 @@ The Job of this module is to:
# versions of Persistent etc get registered.
from BoboPOS import SimpleDB, TJar, SingleThreadedTransaction
import sys, os, string, Globals, OFS.Application
import sys, os, Globals, OFS.Application
Globals.BobobaseName = os.path.join(Globals.data_dir, 'Data.bbb')
Globals.DatabaseVersion='2'
......@@ -63,7 +63,7 @@ bobo_application=app
OFS.Application.initialize(app)
if os.environ.has_key('ZOPE_DATABASE_QUOTA'):
quota=string.atoi(os.environ['ZOPE_DATABASE_QUOTA'])
quota=int(os.environ['ZOPE_DATABASE_QUOTA'])
Bobobase._jar.db.set_quota(
lambda x, quota=quota, otherdb=VersionBase.TDB:
x + otherdb.pos > quota)
......
......@@ -14,7 +14,6 @@
"""
import Globals, OFS.PropertySheets, OFS.Image, ExtensionClass
from string import split, join, strip
import Acquisition, Products
class ZClassBasicSheet(OFS.PropertySheets.PropertySheet,
......
......@@ -15,7 +15,6 @@
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 @@ class ZClassMethodsSheet(
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 @@ class ZClassMethodsSheet(
m._permissionMapper=wrapper
mw=MWp(m)
self.setClassAttr(strip(id), mw)
self.setClassAttr(id.strip(), mw)
r=m
......
......@@ -15,7 +15,6 @@
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 @@ class ZCommonSheet(OFS.PropertySheets.PropertySheet, OFS.SimpleItem.Item):
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 @@ class ZCommonSheet(OFS.PropertySheets.PropertySheet, OFS.SimpleItem.Item):
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 @@ class ZCommonSheet(OFS.PropertySheets.PropertySheet, OFS.SimpleItem.Item):
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')
......
......@@ -12,7 +12,7 @@
##############################################################################
"""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 @@ def createZClassForBase( base_class, pack, nice_name=None, meta_type=None ):
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 @@ class ZClass( Base
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
......
......@@ -10,7 +10,7 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
import time, sys, string, os, thread
import time, sys, os, thread
from zLOG import severity_string, log_time, format_exception
......@@ -49,7 +49,7 @@ def stupid_log_write(subsystem, severity, summary, detail, error):
global _stupid_severity
if _stupid_severity is None:
try: _stupid_severity=string.atoi(os.environ['STUPID_LOG_SEVERITY'])
try: _stupid_severity=int(os.environ['STUPID_LOG_SEVERITY'])
except: _stupid_severity=0
if severity < _stupid_severity: return
......
......@@ -13,7 +13,7 @@
from syslog import syslog_client, LOG_ALERT, LOG_ERR, LOG_WARNING, LOG_NOTICE
from syslog import LOG_INFO, LOG_DEBUG
import os, string, traceback
import os, traceback
pid_str='[%s]: ' % os.getpid()
......@@ -23,7 +23,7 @@ class syslogLogger:
def __init__(self):
if os.environ.has_key('ZSYSLOG_SERVER'):
(addr, port) = string.split(os.environ['ZSYSLOG_SERVER'], ':')
(addr, port) = os.environ['ZSYSLOG_SERVER'].split(':')
self.client = syslog_client((addr, int(port)))
self.on = 1
elif os.environ.has_key('ZSYSLOG'):
......
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