def do_parent(self): #debug ''' self.debug(('self.',self,[ #'ManagementPointDeriveTeamer', 'NameStr' ])) ''' #get ParentedDeriveTeamerVariable=self.ParentDeriveTeamerVariable #Check if ParentedDeriveTeamerVariable!=None: #/####################/# # Now build the chain of Teamers and Managers # #add self.ParentedTotalDeriveTeamersList=[ ParentedDeriveTeamerVariable ]+ParentedDeriveTeamerVariable.ParentedTotalDeriveTeamersList #add if self.TeamTagStr!="": #add self.ParentedDeriveTeamersList=[ ParentedDeriveTeamerVariable ]+ParentedDeriveTeamerVariable.ParentedDeriveTeamersList #set self.ParentedDeriveManagersList=ParentedDeriveTeamerVariable.ParentedDeriveManagersList else: #add self.ParentedDeriveManagersList=[ ParentedDeriveTeamerVariable ]+ParentedDeriveTeamerVariable.ParentedDeriveManagersList #set self.ParentedDeriveTeamersList=ParentedDeriveTeamerVariable.ParentedDeriveTeamersList #map [ self.ParentedTotalPathStr, self.ParentedTeamPathStr, self.ParentedManagementPathStr, ]=map( lambda __ParentedList: Pather.PathPrefixStr+Pather.PathPrefixStr.join( SYS.reverse( map( lambda __ParentedDeriveTeamer: __ParentedDeriveTeamer.ParentKeyStr, __ParentedList ) ) ), map( lambda __KeyStr: getattr(self,__KeyStr), [ 'ParentedTotalDeriveTeamersList', 'ParentedDeriveTeamersList', 'ParentedDeriveManagersList', ] ) ) #debug ''' self.debug( ("self.",self,[ 'ParentedTotalPathStr', 'ParentedTeamPathStr', 'ParentedManagementPathStr' ] ) ) ''' #/####################/# # Set the top teamer variable # #Check if len(self.ParentedTotalDeriveTeamersList)>0: #last one self.ParentTopDeriveTeamerVariable=self.ParentedTotalDeriveTeamersList[-1] #debug ''' self.debug( ('self.',self,['ParentTopDeriveTeamerVariable']) ) ''' else: #set self.ParentTopDeriveTeamerVariable=self #/####################/# # Adapt the shape of the ParentedTriggerVariablesList # for the trigger #init self.ParentedTriggerVariablesList=SYS.SetList( self.ParentingTriggerVariable )
def do_parent(self): #get ParentedDeriveTeamerVariable=self.ParentDeriveTeamerVariable #debug ''' self.debug( [ 'We parent here', ('self.',self,[ #'ManagementPointDeriveTeamer', 'NameStr' ]), 'ParentedDeriveTeamerVariable!=None is', str(ParentedDeriveTeamerVariable!=None) ] ) ''' #Check if ParentedDeriveTeamerVariable!=None: #/####################/# # Set shortly the grand parent # if hasattr(self.ParentDeriveTeamerVariable,'ParentGrandDeriveTeamerVariable'): #get self.ParentGrandDeriveTeamerVariable=self.ParentDeriveTeamerVariable.ParentDeriveTeamerVariable #Check if self.ParentGrandDeriveTeamerVariable!=None: #Check if self.ParentGrandDeriveTeamerVariable.TeamTagStr!="": #set self.ParentGrandTeamTagStr=self.ParentGrandDeriveTeamerVariable.TeamTagStr #Check if self.ParentGrandDeriveTeamerVariable.ManagementTagStr!="": #set self.ParentGrandManagementTagStr=self.ParentGrandDeriveTeamerVariable.ManagementTagStr #/####################/# # Now build the list chain of Teamers and Managers # #add self.ParentedTotalDeriveParentersList=[ ParentedDeriveTeamerVariable ]+ParentedDeriveTeamerVariable.ParentedTotalDeriveParentersList #add if self.TeamTagStr!="": #add self.ParentedTotalDeriveTeamersList=[ ParentedDeriveTeamerVariable ]+ParentedDeriveTeamerVariable.ParentedTotalDeriveTeamersList #set self.ParentedTotalDeriveManagersList=ParentedDeriveTeamerVariable.ParentedTotalDeriveManagersList else: #add self.ParentedTotalDeriveManagersList=[ ParentedDeriveTeamerVariable ]+ParentedDeriveTeamerVariable.ParentedTotalDeriveManagersList #set self.ParentedTotalDeriveTeamersList=ParentedDeriveTeamerVariable.ParentedTotalDeriveTeamersList #/####################/# # Now build the ordered dict chain of Teamers and Managers # #dict self.ParentedTotalListDict=ListDict( map( lambda __ParentedTotalDeriveParenter: ( __ParentedTotalDeriveParenter.TeamTagStr if __ParentedTotalDeriveParenter.TeamTagStr!="" else __ParentedTotalDeriveParenter.ManagementTagStr, __ParentedTotalDeriveParenter ), self.ParentedTotalDeriveParentersList ) ) #debug ''' self.debug( [ 'The ParentedTotalListDict is setted', 'self.ParentedTotalListDict.keys() is ', str(self.ParentedTotalListDict.keys()) ] ) ''' #Check if self.ParentDeriveTeamerVariable.TeamTagStr!='': #init with self.ParentedTotalSingularListDict=ListDict( [( SYS.getSingularStrWithPluralStr( self.ParentDeriveTeamerVariable.TeamTagStr ), self.ParentDeriveTeamerVariable.ParentDeriveTeamerVariable )] ) else: #init self.ParentedTotalSingularListDict=ListDict() #dict self.ParentedTotalSingularListDict.update( SYS.filterNone( map( lambda __ParentedTotalDeriveTeamer: ( SYS.getSingularStrWithPluralStr( __ParentedTotalDeriveTeamer.ParentDeriveTeamerVariable.TeamTagStr ), __ParentedTotalDeriveTeamer ) if __ParentedTotalDeriveTeamer.ParentDeriveTeamerVariable!=None else None, self.ParentedTotalDeriveTeamersList ) ) ) #/####################/# # Now build the paths # #map [ self.ParentedTotalPathStr, self.ParentedTeamPathStr, self.ParentedManagementPathStr, ]=map( lambda __ParentedList: Pather.PathPrefixStr+Pather.PathPrefixStr.join( SYS.reverse( map( lambda __ParentedDeriveTeamer: __ParentedDeriveTeamer.ParentKeyStr, __ParentedList ) ) ), map( lambda __KeyStr: getattr(self,__KeyStr), [ 'ParentedTotalDeriveParentersList', 'ParentedTotalDeriveTeamersList', 'ParentedTotalDeriveManagersList', ] ) ) #debug ''' self.debug( ("self.",self,[ 'ParentedTotalPathStr', 'ParentedTeamPathStr', 'ParentedManagementPathStr' ] ) ) ''' #/####################/# # Set the top teamer variable # #Check if len(self.ParentedTotalDeriveParentersList)>0: #last one self.ParentTopDeriveTeamerVariable=self.ParentedTotalDeriveParentersList[-1] #debug ''' self.debug( ('self.',self,['ParentTopDeriveTeamerVariable']) ) ''' else: #set self.ParentTopDeriveTeamerVariable=self #debug ''' self.debug( [ 'Finally', ('self.',self,['ParentTopDeriveTeamerVariable']) ] ) ''' #/####################/# # link to the ParentTagStr # #set self.ParentTagStr=self.ParentedTotalPathStr.replace('/','_')+'_'+self.ParentKeyStr #/####################/# # Adapt the shape of the ParentedTriggerVariablesList # for the trigger #init self.ParentedTriggerVariablesList=SYS.SetList( self.ParentingTriggerVariable )
#ImportModules import ShareYourSystem as SYS from ShareYourSystem.Guiders import Documenter #Definition a Documenter instance MyDocumenter=Documenter.DocumenterClass().document( map( lambda __BaseClass: __BaseClass.__module__.replace('.','/'), SYS.reverse(SYS.FilerClass.__mro__)[1:] ) #_AllBool=True )
def do_parent(self): #debug ''' self.debug(('self.',self,[ #'ManagementPointDeriveTeamer', 'NameStr' ])) ''' #get ParentedDeriveTeamerVariable=self.ParentDeriveTeamerVariable #Check if ParentedDeriveTeamerVariable!=None: #/####################/# # Check if we have to climb to parent the parent # #debug ''' self.debug('We are going to parent the parent') ''' """ #Parent the parent maybe if self.ParentingClimbBool: #debug ''' self.debug('First we make parent the parent') ''' #parent the parent ParentedDeriveTeamerVariable.parent( self.ParentingTopGetVariable, self.ParentingClimbBool ) #debug ''' self.debug( [ 'Ok parent has parented', 'ParentedDeriveTeamerVariable is '+SYS._str( ParentedDeriveTeamerVariable ) ] ) ''' """ #/####################/# # Now build the chain of Teamers and Managers # #add self.ParentedTotalDeriveTeamersList=[ ParentedDeriveTeamerVariable ]+ParentedDeriveTeamerVariable.ParentedTotalDeriveTeamersList #add if self.TeamTagStr=="": #add self.ParentedDeriveTeamersList=[ ParentedDeriveTeamerVariable ]+ParentedDeriveTeamerVariable.ParentedDeriveTeamersList #set self.ParentedDeriveManagersList=ParentedDeriveTeamerVariable.ParentedDeriveManagersList else: #add self.ParentedDeriveManagersList=[ ParentedDeriveTeamerVariable ]+ParentedDeriveTeamerVariable.ParentedDeriveManagersList #set self.ParentedDeriveTeamersList=ParentedDeriveTeamerVariable.ParentedDeriveTeamersList #map [ self.ParentedTotalPathStr, self.ParentedTeamPathStr, self.ParentedManagementPathStr, ]=map( lambda __ParentedList: Pather.PathPrefixStr+Pather.PathPrefixStr.join( SYS.reverse( map( lambda __ParentedDeriveTeamer: __ParentedDeriveTeamer.ParentKeyStr, __ParentedList ) ) ), map( lambda __KeyStr: getattr(self,__KeyStr), [ 'ParentedTotalDeriveTeamersList', 'ParentedDeriveTeamersList', 'ParentedDeriveManagersList', ] ) ) #debug ''' self.debug( ("self.",self,[ 'ParentedTotalPathStr', 'ParentedTeamPathStr', 'ParentedManagementPathStr' ] ) ) ''' #/####################/# # Set the top teamer variable # #Check if len(self.ParentedTotalDeriveTeamersList)>0: #last one self.ParentTopDeriveTeamerVariable=self.ParentedTotalDeriveTeamersList[-1] #debug ''' self.debug( ('self.',self,['ParentTopDeriveTeamerVariable']) ) ''' #/####################/# # Command things # #debug ''' self.debug(('self.',self,['ParentingTopGetVariable'])) ''' """ #Check if self.ParentingTopGetVariable!=None: #Check if type(self.ParentingTopGetVariable)==list: #debug ''' self.debug( 'This is a list' ) ''' #get ParentedValueVariablesList=self.ParentTopDeriveTeamerVariable[ '#map@get']( *self.ParentingTopGetVariable ).ItemizedMapValueVariablesList #debug ''' self.debug('ParentedValueVariablesList is '+str(ParentedValueVariablesList)) ''' #Link self['#map@set']( zip( self.ParentingTopGetVariable, ParentedValueVariablesList ) ) else: #Link self.set( self.ParentingTopGetVariable, self.ParentTopDeriveTeamerVariable[ self.ParentingTopGetVariable ] ) """ else: #set self.ParentTopDeriveTeamerVariable=self #/####################/# # Adapt the shape of the ParentedTriggerVariablesList # for the trigger #init self.ParentedTriggerVariablesList=SYS.SetList( self.ParentingTriggerVariable )