[Zope-Checkins] CVS: Zope3/lib/python/Zope/TAL - TALGenerator.py:1.52.16.3.4.5

Fred L. Drake, Jr. fdrake@acm.org
Wed, 22 May 2002 15:48:39 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/TAL
In directory cvs.zope.org:/tmp/cvs-serv4389/lib/python/Zope/TAL

Modified Files:
      Tag: fdrake-tal-i18n-branch
	TALGenerator.py 
Log Message:
Remove some debugging prints that were commented out.
Update a comment.
Add back a line that was accidentally removed during the initial attempt
to add I18N support -- this now passes the existing unit tests.


=== Zope3/lib/python/Zope/TAL/TALGenerator.py 1.52.16.3.4.4 => 1.52.16.3.4.5 ===
     def replaceAttrs(self, attrlist, repldict):
         # Each entry in attrlist starts like (name, value).
-        # Result is (name, value, action, expr) if there is a
+        # Result is (name, value, action, expr, xlat) if there is a
         # tal:attributes entry for that attribute.  Additional attrs
         # defined only by tal:attributes are added here.
         #
@@ -542,7 +542,6 @@
         if attrsubst or i18nattrs:
             if attrsubst:
                 repldict = parseAttributeReplacements(attrsubst)
-                #print >>sys.__stderr__, "emitStartElement", name, `repldict`
             else:
                 repldict = {}
             if i18nattrs:
@@ -552,8 +551,6 @@
             # Convert repldict's name-->expr mapping to a
             # name-->(compiled_expr, translate) mapping
             for key, value in repldict.items():
-                #if key == 'src':
-                #    print >>sys.__stderr__, "src = %r" % value
                 repldict[key] = self.compileExpression(value), key in i18nattrs
             for key in i18nattrs:
                 if key not in repldict:
@@ -562,6 +559,7 @@
             repldict = {}
         if replace:
             todo["repldict"] = repldict
+            repldict = {}
         self.emitStartTag(name, self.replaceAttrs(attrlist, repldict), isend)
         if optTag:
             self.pushProgram()