def mimic_set(self): """ """ #debug ''' self.debug(('self.',self,[ 'SettingKeyVariable', #'SettingValueVariable' ])) ''' #Definition OutputDict={'HookingIsBool':True} #Appending set if self.SettingKeyVariable.startswith(NodingPrefixGetStr): #Definition the SplittedStrsList SplittedStrsList=self.SettingKeyVariable.split(NodingSuffixGetStr) #Definition the NodingCollectionStr NodingCollectionStr=NodingPrefixGetStr.join( SplittedStrsList[0].split(NodingPrefixGetStr)[1:]) #Check if it is an append of Nodes IsNoderBool='NoderClass' in map( lambda __Class: __Class.__name__, type(self.SettingValueVariable).__mro__ ) #debug ''' self.debug(('vars ',vars(),['NodingCollectionStr','IsNoderBool'])) ''' #Nodify self.node( NodingCollectionStr, #**{'IsNoderBool':IsNoderBool} ) #Definition the KeyStr SetTagStr=NodingSuffixGetStr.join(SplittedStrsList[1:]) #debug ''' self.debug('SetTagStr is '+SetTagStr) ''' #Append (or set if it is already in) Pather.setWithPathVariableAndKeyVariable( self.NodedCollectionOrderedDict, Pather.PathPrefixStr+SetTagStr, self.SettingValueVariable ) if Pather.PathPrefixStr not in SetTagStr: #debug ''' self.debug(('self.',self,['SettingValueVariable'])) ''' #If it is an object if IsNoderBool: #global global NodingCollectionPrefixStr NodedMethodStr='__setattr__' NodedMethod=getattr(self.SettingValueVariable,NodedMethodStr) #Int and Set Child attributes NodedMethod( NodingCollectionPrefixStr+'CollectionStr', self.NodingCollectionStr ) NodedMethod( NodingCollectionPrefixStr+'IndexInt', len(self.NodedCollectionOrderedDict)-1 ) NodedMethod( NodingCollectionPrefixStr+'KeyStr', SetTagStr ) self.SettingValueVariable.point( self.NodedCollectionOrderedDict, NodingCollectionPrefixStr+'PointOrderedDict' ) self.SettingValueVariable.point( self, NodingCollectionPrefixStr+'PointDeriveNoder' ) #Return OutputDict['HookingIsBool']=False #<Hook>return OutputDict return OutputDict #Call the parent get method if OutputDict['HookingIsBool']: return BaseClass.set(self)
def set(self): """ """ #debug ''' self.debug('Start of the method') ''' #Definition OutputDict={'HookingIsBool':True} #Appending set if self.SettingKeyVariable.startswith(NodingPrefixGetStr): #Definition the SplittedStrsList SplittedStrsList=self.SettingKeyVariable.split(NodingSuffixGetStr) #Definition the NodingCollectionStr NodingCollectionStr=NodingPrefixGetStr.join( SplittedStrsList[0].split(NodingPrefixGetStr)[1:]) #Check if it is an append of Nodes IsNoderBool='NoderClass' in map( lambda __Class: __Class.__name__, type(self.SettingValueVariable).__mro__ ) #debug ''' self.debug(('vars ',vars(),['NodingCollectionStr','IsNoderBool'])) ''' #Nodify self.node(NodingCollectionStr,**{'IsNoderBool':IsNoderBool}) #Definition the KeyStr SettedKeyStr=NodingSuffixGetStr.join(SplittedStrsList[1:]) #debug ''' self.debug('KeyStr is '+KeyStr) ''' #Append (or set if it is already in) Pather.setWithPathVariableAndKeyVariable( self.NodedCollectionOrderedDict, Pather.PathPrefixStr+SettedKeyStr, self.SettingValueVariable ) #If it is an object if IsNoderBool: #Int and Set Child attributes self.SettingValueVariable.__setattr__(self.NodedPrefixStr+'Int',len(self.NodedCollectionOrderedDict)-1) NodedStrKeyStr=self.NodedPrefixStr+'KeyStr' self.SettingValueVariable.__setitem__(NodedStrKeyStr,SettedKeyStr) self.SettingValueVariable.__setattr__(self.NodedPrefixStr+'ParentPointer',self) #Init GrandChild attributes ''' self.SettingValueVariable.__setattr__(self.NodedPrefixStr+'PathStr',"") self.SettingValueVariable.__setattr__(self.NodedPrefixStr+'GrandParentPointersList',[]) ''' #Return OutputDict['HookingIsBool']=False #<Hook>return OutputDict #Call the parent get method if OutputDict['HookingIsBool']: BaseClass.set(self)