From 380105a51658c64171d317d9e42fe7ca519b1a10 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 8 Apr 2019 18:47:09 +0200 Subject: [PATCH] debug for SMESH plugin padder --- src/KERNEL_PY/kernel/datamodeler.py | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/KERNEL_PY/kernel/datamodeler.py b/src/KERNEL_PY/kernel/datamodeler.py index 9a5808239..6c7389125 100644 --- a/src/KERNEL_PY/kernel/datamodeler.py +++ b/src/KERNEL_PY/kernel/datamodeler.py @@ -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 = ( -- 2.39.2