opental-checkins
[Top][All Lists]
Advanced

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

[OpenTAL-checkins] opental/OpenTAL metal_handler.py


From: Fernando Lalo Martins
Subject: [OpenTAL-checkins] opental/OpenTAL metal_handler.py
Date: Mon, 28 Apr 2003 14:15:14 -0400

CVSROOT:        /cvsroot/opental
Module name:    opental
Changes by:     Fernando Lalo Martins <address@hidden>  03/04/28 14:15:14

Modified files:
        OpenTAL        : metal_handler.py 

Log message:
        fixing use-macro sanity check to avoid breaking on default or nothing

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/opental/opental/OpenTAL/metal_handler.py.diff?tr1=1.18&tr2=1.19&r1=text&r2=text

Patches:
Index: opental/OpenTAL/metal_handler.py
diff -u opental/OpenTAL/metal_handler.py:1.18 
opental/OpenTAL/metal_handler.py:1.19
--- opental/OpenTAL/metal_handler.py:1.18       Fri Feb 21 00:07:02 2003
+++ opental/OpenTAL/metal_handler.py    Mon Apr 28 14:15:14 2003
@@ -94,13 +94,15 @@
 def handle_use_macro(element, context, value):
     value = getattr(element, 'metal_macro', value)
     macro = context.evaluateMacro(value)
+    if hasattr(context, 'getDefault') and macro is context.getDefault():
+        return element
+    if macro is None:
+        return None
     try:
         [a for a in macro.children]
     except:
         raise MetalError, ('trying to use an incompatible object as a macro: ' 
+
                            repr(macro))
-    if hasattr(context, 'getDefault') and macro is context.getDefault():
-        return element
     context.metal_slot_stack[-1] = fish_slots(element)
     result = macro.copy()
     metal = result.attributes[metal_ns]




reply via email to

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