Salome HOME
debug for SMESH plugin padder
authorPaul RASCLE <paul.rascle@edf.fr>
Mon, 8 Apr 2019 16:47:09 +0000 (18:47 +0200)
committerPaul RASCLE <paul.rascle@edf.fr>
Mon, 8 Apr 2019 18:36:17 +0000 (20:36 +0200)
src/KERNEL_PY/kernel/datamodeler.py

index 9a58082397bf2a159fb2910a1eecab99f16d2203..6c7389125d08bf4e0a02fb841640d049ea8d0ade 100644 (file)
@@ -26,7 +26,7 @@
 __author__="gboulant"
 __date__ ="$15 avr. 2010 19:44:17$"
 
-from .uiexception import DevelException
+#from .uiexception import DevelException
 
 # Most usable class types
 TypeString= "".__class__
@@ -38,6 +38,7 @@ __ref_list = []
 TypeList = __ref_list.__class__
 __ref_dict = {}
 TypeDictionnary = __ref_dict.__class__
+from .enumerate import Enumerate
 
 # There is no control to do for these attributes. They are attributes for the
 # class management and not data of the model.
@@ -45,7 +46,7 @@ UNCHECKED_ATTRIBUTES = [
     "_typemap",
     "_rangemap",
     "_defaultmap",
-    "_voidmap"
+    "_voidmap",
 ]
 
 ## This class is a placeholder for modeling data. An object based on this class
@@ -127,8 +128,10 @@ class DataModeler:
         self.__setattr__(name,default)
 
     def __setattr__(self, name, val):
+        print (self, name, val)
         if name in UNCHECKED_ATTRIBUTES:
-            self.__dict__[name] = val
+            #self.__dict__[name] = val
+            object.__setattr__(self, name, val)
             return
 
         #__GBO_DEBUG_
@@ -156,16 +159,25 @@ class DataModeler:
     
     def __getattribute__(self, name):
         if name in UNCHECKED_ATTRIBUTES:
-            return self.__dict__[name]
+           return object.__getattribute__(self, name)
 
+        if name in DataModeler.__dict__:
+           return object.__getattribute__(self, name)
+
+        #import traceback
+        #traceback.print_stack()
         if name not in self._typemap:
-            raise DevelException("The class "+str(self.__class__)+" has no attribute "+str(name))
+            raise DevelException("The class  has no attribute "+str(name))
         # The attribute coulb be requested while it has not been created yet (for
         # example if we did't call the setter before).
-        if name not in self.__dict__:
+        if name not in self.__dict__.keys():
             return None
-        
-        return self.__dict__[name]
+
+        return object.__getattribute__(self, name)
+
+
+
+
 
     def __isNotValidType(self, name, val):
         isNotValid = (