[ZPT] CVS: Zope3/lib/python/Zope/TAL - TALInterpreter.py:1.63.10.1
Fred Drake Jr
fdrake@acm.org
Mon, 19 Nov 2001 17:03:12 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/TAL
In directory cvs.zope.org:/tmp/cvs-serv10216/TAL
Modified Files:
Tag: Zope-3x-branch
TALInterpreter.py
Log Message:
Remove use of string & strop modules; just use string methods.
This avoids some warnings in Python 2.2.
=== Zope3/lib/python/Zope/TAL/TALInterpreter.py 1.63 => 1.63.10.1 ===
from cgi import escape
-from string import join, lower, rfind
-try:
- from strop import lower, rfind
-except ImportError:
- pass
try:
from cStringIO import StringIO
@@ -234,10 +229,9 @@
self._stream_write("\n")
self.col = 0
- def stream_write(self, s,
- len=len, rfind=rfind):
+ def stream_write(self, s):
self._stream_write(s)
- i = rfind(s, '\n')
+ i = s.rfind('\n')
if i < 0:
self.col = self.col + len(s)
else:
@@ -338,7 +332,7 @@
# Clear 'entering' flag
macs[-1][2] = 0
# Convert or drop depth-one METAL attributes.
- i = rfind(name, ":") + 1
+ i = name.rfind(":") + 1
prefix, suffix = name[:i], name[i:]
if suffix == "define-macro":
# Convert define-macro as we enter depth one.
@@ -362,7 +356,7 @@
if action > 1:
return self.attrAction(item)
ok = 1
- if self.html and lower(name) in BOOLEAN_HTML_ATTRS:
+ if self.html and name.lower() in BOOLEAN_HTML_ATTRS:
evalue = self.engine.evaluateBoolean(item[3])
if evalue is self.Default:
if action == 1: # Cancelled insert
@@ -490,7 +484,7 @@
return
s = escape(text)
self._stream_write(s)
- i = rfind(s, '\n')
+ i = s.rfind('\n')
if i < 0:
self.col = self.col + len(s)
else: