[Checkins] SVN:	Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py	Only quote static attributes.
    Malthe Borch 
    mborch at gmail.com
       
    Sun Nov 16 22:18:14 EST 2008
    
    
  
Log message for revision 93032:
  Only quote static attributes.
Changed:
  U   Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py
-=-
Modified: Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py
===================================================================
--- Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py	2008-11-17 03:05:21 UTC (rev 93031)
+++ Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py	2008-11-17 03:18:13 UTC (rev 93032)
@@ -215,9 +215,11 @@
                 else:
                     expression = self.translate_expression(value)
             else:
-                if variable in dynamic_attr_names or variable in attributes:
-                    text = '"%s"' % attributes[variable]
-                    expression = self.translate_expression(text)
+                value = attributes.get(variable)
+                if value is not None:
+                    if variable not in dynamic_attr_names:
+                        value = '"%s"' % value
+                    expression = self.translate_expression(value)
                 else:
                     raise ValueError("Must be either static or dynamic "
                                      "attribute when no message id "
    
    
More information about the Checkins
mailing list