def mimic_get(self): #debug ''' self.debug(("self.",self,['GettingKeyVariable'])) ''' #Definition OutputDict={'HookingIsBool':True} #Appending set if self.GettingKeyVariable.startswith(NodingPrefixGetStr): #Definition the SplittedStrsList SplittedStrsList=self.GettingKeyVariable.split(NodingSuffixGetStr) #Definition the NodingCollectionStr NodingCollectionStr=NodingPrefixGetStr.join( SplittedStrsList[0].split(NodingPrefixGetStr)[1:]) #debug ''' self.debug( [ 'NodingCollectionStr is '+NodingCollectionStr, 'We are going to node' ] ) ''' #Nodify self.node( NodingCollectionStr, #**{'IsNoderBool':False} ) #Definition of the KeyStr GetKeyStr=NodingSuffixGetStr.join(SplittedStrsList[1:]) #debug ''' self.debug( [ 'node is done', 'GetKeyStr is '+GetKeyStr, 'self.NodedCollectionOrderedDict is '+str(self.NodedCollectionOrderedDict) ] ) ''' #Get with a digited KeyStr case if GetKeyStr.isdigit(): #Definition the GetInt GetInt=(int)(GetKeyStr) #Check if the size is ok if GetInt<len(self.NodedCollectionOrderedDict): #Get the GettedVariable self.GettedValueVariable=SYS.get( self.NodedCollectionOrderedDict, 'values', GetInt ) #Return OutputDict['HookingIsBool']=False #<Hook>return OutputDict #Get in the ValueVariablesList elif GetKeyStr=="": #Get the GettedVariable self.GettedValueVariable=self.NodedCollectionOrderedDict.values() #Return OutputDict['HookingIsBool']=False #<Hook>return OutputDict elif GetKeyStr in self.NodedCollectionOrderedDict: #Get the GettedVariable self.GettedValueVariable=self.NodedCollectionOrderedDict[GetKeyStr] #Return OutputDict['HookingIsBool']=False #<Hook>return OutputDict #Call the parent get method if OutputDict['HookingIsBool']: #debug ''' self.debug( [ ('self.',self,['GettingKeyVariable']), 'BaseClass.get is '+str(BaseClass.get) ] ) ''' #Call return BaseClass.get(self) else: #return return OutputDict
def mimic_set(self): #Check if self.SettingKeyVariable in [ FigurePlotKeyStr, FigureScatterKeyStr, FigureBarKeyStr ]: #debug ''' self.debug( [ 'before plot', ('self.',self,[ #'ViewDeriveControllerVariable', 'SettingValueVariable' ]) ] ) ''' #init FigurePlotArgumentDict=Setter.ArgumentDict( self.SettingValueVariable, self.ViewDeriveControllerVariable ) #debug ''' self.debug( [ 'We plot here', 'FigurePlotArgumentDict is', SYS._str(FigurePlotArgumentDict) ] ) ''' #plot self.FigureCartoonVariablesList.append( self.FiguredAxesVariable.plot( *FigurePlotArgumentDict['LiargVariablesList'], **FigurePlotArgumentDict['KwargVariablesDict'] )[0] ) #debug ''' self.debug( [ ('self.',self,['FigureCartoonVariablesList']), #str(self.FigureCartoonVariablesList[0][0]), ] ) ''' #return return {'HookingIsBool':False} elif self.SettingKeyVariable==FigureAxesKeyStr: #debug ''' self.debug( [ 'before axes', ('self.',self,[ #'ViewDeriveControllerVariable', 'FiguredAxesVariable' ]) ] ) ''' #map ArgumentTuplesList=map( lambda __ItemTuple: ( __ItemTuple[0], Setter.ArgumentDict( __ItemTuple[1], self.ViewDeriveControllerVariable ) ), SYS.SetList( self.SettingValueVariable ) ) #debug ''' self.debug( [ 'We axe here', 'ArgumentTuplesList is ', SYS._str(ArgumentTuplesList), ] ) ''' #map map( lambda __ArgumentTuple: SYS.get( self.FiguredAxesVariable, __ArgumentTuple[0] )() if len(__ArgumentTuple[1]['LiargVariablesList'] )==0 and __ArgumentTuple[1]['KwargVariablesDict']==None else( SYS.get( self.FiguredAxesVariable, __ArgumentTuple[0] )(**__ArgumentTuple[1]['KwargVariablesDict']) if len(__ArgumentTuple[1]['LiargVariablesList'] )==0 else( SYS.get( self.FiguredAxesVariable, __ArgumentTuple[0] )( *__ArgumentTuple[1]['LiargVariablesList'], **__ArgumentTuple[1]['KwargVariablesDict'] ) if __ArgumentTuple[1]['KwargVariablesDict']!=None else SYS.get( self.FiguredAxesVariable, __ArgumentTuple[0] )( *__ArgumentTuple[1]['LiargVariablesList'] ) ) ), ArgumentTuplesList ) #return return {'HookingIsBool':False} elif type(self.SettingKeyVariable)==str and self.SettingKeyVariable.startswith( FigureMpld3KeyStr): #deprefix ToolTipKeyStr=SYS.deprefix( self.SettingKeyVariable, FigureMpld3KeyStr ) #debug ''' self.debug( [ 'before plugins', ('self.',self,['ViewDeriveControllerVariable']) ] ) ''' #init FigurePluginArgumentDict=Setter.ArgumentDict( self.SettingValueVariable, self.ViewDeriveControllerVariable ) #debug ''' self.debug( [ 'We plugin here', 'FigurePluginArgumentDict is ', SYS._str(FigurePluginArgumentDict) ] ) ''' #plugin from mpld3 import plugins self.FigureTooltipVariablesList=map( lambda __FigureCartoonVariable: getattr( plugins, ToolTipKeyStr )( *[ __FigureCartoonVariable ]+FigurePluginArgumentDict['LiargVariablesList'], **FigurePluginArgumentDict['KwargVariablesDict'] ), self.FigureCartoonVariablesList ) #debug ''' self.debug( [ ('self.',self,['FigureTooltipVariablesList']) ] ) ''' #connect map( lambda __FigureTooltipVariable: plugins.connect( self.FigurePyplotVariable, __FigureTooltipVariable ), self.FigureTooltipVariablesList ) #return return {'HookingIsBool':False} #call the base method BaseClass.set(self)
def mimic_set(self): #Check if self.SettingKeyVariable in [ PyplotPlotKeyStr, PyplotScatterKeyStr, PyplotBarKeyStr ]: #/####################/# # first maybe pyplot if it was not already # #debug ''' self.debug( [ 'we maybe pyplot first', ] ) ''' #pyplot self.pyplot() #/####################/# # Then add in the plot # #debug ''' self.debug( [ 'before plot', ('self.',self,[ #'PyplotedParentFigureDerivePyploterVariable', 'SettingValueVariable' ]) ] ) ''' #init PyplotPlotArgumentDict=Setter.ArgumentDict( self.SettingValueVariable, self.PyplotedParentFigureDerivePyploterVariable ) #debug ''' self.debug( [ 'We plot here', 'PyplotPlotArgumentDict is', SYS._str(PyplotPlotArgumentDict) ] ) ''' #plot self.PyplotedLinesList.append( self.PyplotedAxesVariable.plot( *PyplotPlotArgumentDict['LiargVariablesList'], **PyplotPlotArgumentDict['KwargVariablesDict'] )[0] ) #debug ''' self.debug( [ ('self.',self,['PyplotedLinesList']), #str(self.PyplotedLinesList[0][0]), ] ) ''' #return return {'HookingIsBool':False} elif self.SettingKeyVariable==PyplotAxesKeyStr: #debug ''' self.debug( [ 'before axes', ('self.',self,[ #'PyplotedParentFigureDerivePyploterVariable', 'PyplotedAxesVariable' ]) ] ) ''' #map ArgumentTuplesList=map( lambda __ItemTuple: ( __ItemTuple[0], Setter.ArgumentDict( __ItemTuple[1], self.PyplotedParentFigureDerivePyploterVariable ) ), SYS.SetList( self.SettingValueVariable ) ) #debug ''' self.debug( [ 'We axe here', 'ArgumentTuplesList is ', SYS._str(ArgumentTuplesList), ] ) ''' #map map( lambda __ArgumentTuple: SYS.get( self.PyplotedAxesVariable, __ArgumentTuple[0] )() if len(__ArgumentTuple[1]['LiargVariablesList'] )==0 and __ArgumentTuple[1]['KwargVariablesDict']==None else( SYS.get( self.PyplotedAxesVariable, __ArgumentTuple[0] )(**__ArgumentTuple[1]['KwargVariablesDict']) if len(__ArgumentTuple[1]['LiargVariablesList'] )==0 else( SYS.get( self.PyplotedAxesVariable, __ArgumentTuple[0] )( *__ArgumentTuple[1]['LiargVariablesList'], **__ArgumentTuple[1]['KwargVariablesDict'] ) if __ArgumentTuple[1]['KwargVariablesDict']!=None else SYS.get( self.PyplotedAxesVariable, __ArgumentTuple[0] )( *__ArgumentTuple[1]['LiargVariablesList'] ) ) ), ArgumentTuplesList ) #return return {'HookingIsBool':False} elif type(self.SettingKeyVariable)==str and self.SettingKeyVariable.startswith( PyplotMpld3KeyStr): #deprefix ToolTipKeyStr=SYS.deprefix( self.SettingKeyVariable, PyplotMpld3KeyStr ) #debug ''' self.debug( [ 'before plugins', ('self.',self,['PyplotedParentFigureDerivePyploterVariable']) ] ) ''' #init PyplotPluginArgumentDict=Setter.ArgumentDict( self.SettingValueVariable, self.PyplotedParentFigureDerivePyploterVariable ) #debug ''' self.debug( [ 'We plugin here', 'PyplotPluginArgumentDict is ', SYS._str(PyplotPluginArgumentDict) ] ) ''' #plugin from mpld3 import plugins self.PyplotTooltipVariablesList=map( lambda __PyplotCartoonVariable: getattr( plugins, ToolTipKeyStr )( *[ __PyplotCartoonVariable ]+PyplotPluginArgumentDict['LiargVariablesList'], **PyplotPluginArgumentDict['KwargVariablesDict'] ), self.PyplotedLinesList ) #debug ''' self.debug( [ ('self.',self,['PyplotTooltipVariablesList']) ] ) ''' #connect map( lambda __PyplotTooltipVariable: plugins.connect( self.PyplotedFigureVariable, __PyplotTooltipVariable ), self.PyplotTooltipVariablesList ) #return return {'HookingIsBool':False} #we set a Chart #call the base method BaseClass.set(self)