[Zope-Coders] Re: [Zope-Checkins] CVS: Zope/lib/python/TAL - TALInterpreter.py:1.65

Tres Seaver tseaver@zope.com
Thu, 24 Jan 2002 08:18:47 -0500


Chris Withers wrote:

> Update of /cvs-repository/Zope/lib/python/TAL
> In directory cvs.zope.org:/tmp/cvs-serv20859
> 
> Modified Files:
> 	TALInterpreter.py 
> Log Message:
> Should strop some DeprecationWarnings. I left the rfind at line 166 since

 > it wasn't obvious what to do, maybe someone else can fix it?

WAAAA!  I started to make the same patch the other day, but then
exploited my "walk around the corner" access to check with Evan;
it turns out that PageTemplates (and therefore TAL and ZTUtils)
still need to maintain Python 1.5.2 compatibility, until the ZPT
community no longer needs it.  We should probably revert your checkin,
and then re-do it on a branch (unless Evan has already polled the
community and you are acting on the results, in which case I
withdraw my objection).


> 
> === Zope/lib/python/TAL/TALInterpreter.py 1.64 => 1.65 ===
>  
>  from cgi import escape
> -from string import join, lower, rfind
> +from string import rfind
>  try:
> -    from strop import lower, rfind
> +    from strop import rfind
>  except ImportError:
>      pass
>  
> @@ -266,7 +266,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.
> @@ -290,7 +290,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
> @@ -418,7 +418,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:
> 
> 
> _______________________________________________
> Zope-Checkins maillist  -  Zope-Checkins@zope.org
> http://lists.zope.org/mailman/listinfo/zope-checkins
> 



-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com