changeset 488:747eaa662353

browser side (nativedom): new properties managed: TEXT_NODE, ELEMENT_NODE, ATTRIBUTE_NODE, COMMENT_NODE, nodeType
author Goffi <goffi@goffi.org>
date Tue, 24 Jun 2014 00:42:45 +0200
parents e588335b6aa8
children 1ce6133993e4
files src/browser/sat_browser/nativedom.py
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/browser/sat_browser/nativedom.py	Thu Jun 19 19:28:17 2014 +0200
+++ b/src/browser/sat_browser/nativedom.py	Tue Jun 24 00:42:45 2014 +0200
@@ -25,7 +25,7 @@
 from __pyjamas__ import JS
 
 
-class Node():
+class Node(object):
 
     def __init__(self, js_node):
         self._node = js_node
@@ -37,13 +37,10 @@
             ret.append(self.__class__(js_nodes_list.item(i)))  # XXX: Ugly, but used to word around a Pyjamas's bug
         return ret
 
-    @property
-    def nodeName(self):
-        return self._node.nodeName
-
-    @property
-    def wholeText(self):
-        return self._node.wholeText
+    def __getattr__(self, name):
+        if name in ('TEXT_NODE', 'ELEMENT_NODE', 'ATTRIBUTE_NODE', 'COMMENT_NODE', 'nodeName', 'nodeType', 'wholeText'):
+            return getattr(self._node, name)
+        return object.__getattribute__(self, name)
 
     @property
     def childNodes(self):