opental-checkins
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OpenTAL-checkins] opental/pax paxtransform.py


From: Fernando Lalo Martins
Subject: [OpenTAL-checkins] opental/pax paxtransform.py
Date: Mon, 24 Mar 2003 16:03:17 -0500

CVSROOT:        /cvsroot/opental
Module name:    opental
Changes by:     Fernando Lalo Martins <address@hidden>  03/03/24 16:03:17

Modified files:
        pax            : paxtransform.py 

Log message:
        standard refactoring: "replace temp with query"
        this allows handlers to change the element's ns

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/opental/opental/pax/paxtransform.py.diff?tr1=1.26&tr2=1.27&r1=text&r2=text

Patches:
Index: opental/pax/paxtransform.py
diff -u opental/pax/paxtransform.py:1.26 opental/pax/paxtransform.py:1.27
--- opental/pax/paxtransform.py:1.26    Thu Feb 27 16:51:11 2003
+++ opental/pax/paxtransform.py Mon Mar 24 16:03:17 2003
@@ -54,27 +54,13 @@
         processed = []
         context.postprocess_queue.append(processed)
         try:
-            e_ns_h = hash(element.ns)
-        except AttributeError:
-            e_ns_h = None
-        try:
             for ns, h, handler in self.handlers:
                 if not hasattr(result, 'attributes'):
                     break
                 # We compare the hash of the ns against the hash of the 
element's ns
                 # this avoids an expensive unicode character-by-character 
comparison,
                 # in exchange for hash computation which is cached.
-                #
-                # However, this also means you can't change an element's ns in 
one
-                # transform handler and expect it to affect future handlers.
-                #
-                # Then again, if you wanted to do that, you probably should be 
shot.
-                #
-                #
-                #
-                #
-                # (just kidding)
-                if result.attributes.has_key(ns) or e_ns_h == h:
+                if result.attributes.has_key(ns) or hash(element.ns) == h:
                     processed.append(handler)
                     result = handler(result, context)
         except StopTransform, data:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]