[Checkins] SVN: Sandbox/malthe/chameleon.html/ Updated static attributes handling.

Malthe Borch mborch at gmail.com
Sat Nov 29 04:26:56 EST 2008


Log message for revision 93437:
  Updated static attributes handling.

Changed:
  U   Sandbox/malthe/chameleon.html/CHANGES.txt
  U   Sandbox/malthe/chameleon.html/src/chameleon/html/language.py

-=-
Modified: Sandbox/malthe/chameleon.html/CHANGES.txt
===================================================================
--- Sandbox/malthe/chameleon.html/CHANGES.txt	2008-11-28 23:22:33 UTC (rev 93436)
+++ Sandbox/malthe/chameleon.html/CHANGES.txt	2008-11-29 09:26:55 UTC (rev 93437)
@@ -4,6 +4,8 @@
 HEAD
 ~~~~
 
+- Updated static attributes handling. [malthe]
+
 chameleon.html 0.6 (released 11/19/2008)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

Modified: Sandbox/malthe/chameleon.html/src/chameleon/html/language.py
===================================================================
--- Sandbox/malthe/chameleon.html/src/chameleon/html/language.py	2008-11-28 23:22:33 UTC (rev 93436)
+++ Sandbox/malthe/chameleon.html/src/chameleon/html/language.py	2008-11-29 09:26:55 UTC (rev 93437)
@@ -63,7 +63,11 @@
         define_symbol = '_define'
         composite_attr_symbol = '_composite_attr'
         rebase_symbol = '_rebase'
-        
+
+        ns_omit = (
+            "http://xml.zope.org/namespaces/meta",
+            "http://namespaces.repoze.org/xss")
+
         @property
         def omit(self):
             return self.element.xss_omit.lower() in true_values
@@ -73,6 +77,11 @@
             if self.element.xss_attributes is not None:
                 xhtml_attributes = utils.get_attributes_from_namespace(
                     self.element, config.XHTML_NS)
+
+                if self.element.prefix is None:
+                    xhtml_attributes.update(utils.get_attributes_from_namespace(
+                        self.element, None))
+
                 attrib = repr(tuple(xhtml_attributes.items()))
 
                 names = self.element.xss_attributes.split(',')
@@ -131,9 +140,15 @@
         
         @property
         def static_attributes(self):
-            return utils.get_attributes_from_namespace(
+            xhtml_attributes = utils.get_attributes_from_namespace(
                 self.element, config.XHTML_NS)
 
+            if self.element.prefix is None:
+                xhtml_attributes.update(utils.get_attributes_from_namespace(
+                    self.element, None))
+
+            return xhtml_attributes
+
         @property
         def skip(self):
             if self.define_slot is not None:



More information about the Checkins mailing list