def __init__( self, resolvers = None, dom_storage = None, dom_father = None, *args, **kwargs ): ICloudMgrResolvers.__init__( self, resolvers ) ICloudMgrComet.__init__( self ) IDomTree.__init__( self, dom_storage = dom_storage, dom_father = dom_father, ) IDynamicComponentProvider.__init__( self )
def __init__( self, dom_storage=None, dom_father=None, cloudmgrweb=None, ): ICloudMgrComet.__init__(self) IDomTree.__init__( self, dom_storage=dom_storage, dom_father=dom_father, ) self._cloudmgrweb = cloudmgrweb
def __init__(self, resolvers=None, dom_storage=None, dom_father=None, *args, **kwargs): ICloudMgrResolvers.__init__(self, resolvers) ICloudMgrComet.__init__(self) IDomTree.__init__( self, dom_storage=dom_storage, dom_father=dom_father, ) IDynamicComponentProvider.__init__(self)
def __init__( self, dom_storage = None, dom_father = None, cloudmgrweb = None, ): ICloudMgrComet.__init__( self ) IDomTree.__init__( self, dom_storage = dom_storage, dom_father = dom_father, ) self._cloudmgrweb = cloudmgrweb
def __init__( self, resolvers = None, dom_storage = None, dom_father = None, *args, **kwargs ): ICloudMgrResolvers.__init__( self, resolvers ) # Interaction comet ICloudMgrComet.__init__( self ) IDynamicComponentProvider.__init__( self ) IDomTree.__init__( self, dom_storage = dom_storage, dom_father = dom_father, ) @with_cloudmap_resolver( self ) def get_cloudmap_in_a_list( *args, **kwargs ): result = kwargs[ 'with_cloudmap_resolver' ].cloudmap.copy() return [ result ] def get_list_from_attribute( l, attribute = None ): l_result = [] for e in l: result = [] if getattr( self, attribute ) and getattr( self, attribute ) <> '*': result = e.get( getattr( self, attribute ), [] ) else: result = e.values() if type( result ) == dict: result = [ result ] l_result.extend( result ) return l_result def print_struct( x ): pprint( x ) print return x def sum_element_on_list( l ): result = 0 for e in l: result = result + len( e ) return result SequentialOps.__init__( self, self.cloudmap_resolver, [ get_cloudmap_in_a_list, lambda l, attribute = 'aera': get_list_from_attribute( l, attribute ), lambda l, attribute = 'appcode': get_list_from_attribute( l, attribute ), lambda l, attribute = 'env': get_list_from_attribute( l, attribute ), lambda l, attribute = 'appcomp': get_list_from_attribute( l, attribute ), sum_element_on_list, ] )
def __init__( self, ): default_appcode = '' ICloudMgrResolvers.__init__( self ) # Interaction comet ICloudMgrComet.__init__( self ) # Création de l'interface # permettant la génération # des composants de manière # dynamique et avec # alimentation de l'objet en proprerties IDynamicComponentProvider.__init__( self ) IDomTree.__init__( self, dom_storage = None, dom_father = None ) # Définition des composants dynamiques # Menu de controle def create_cp_menu_control(): with self.cloudmap_resolver: return component.Component( MenuControl( appcode = default_appcode, dom_storage = self, dom_father = self, ) ) self.create_dynamic_component( 'cp_menu_control', create_cp_menu_control ) # affichage des zones def create_cp_aeras_viewer(): with self.cloudmap_resolver: return component.Component( AerasViewer( appcode = default_appcode, resolvers = self, dom_storage = self, dom_father = self, ) ) self.create_dynamic_component( 'cp_aeras_viewer', create_cp_aeras_viewer ) # Formulaire pour les rechargements # suite à un message comet def create_cp_form_refresh_on_comet(): return component.Component( FormRefreshOnComet( dom_storage = self, dom_father = self, ) ) self.create_dynamic_component( 'cp_form_refresh_on_comet', create_cp_form_refresh_on_comet ) def create_cp_debug(): return component.Component( CloudmgrwebDebug( dom_storage = self, dom_father = self, cloudmgrweb = self, ) ) self.create_dynamic_component( 'cp_debug', create_cp_debug, )
def __init__(self, resolvers=None, dom_storage=None, dom_father=None, *args, **kwargs): ICloudMgrResolvers.__init__(self, resolvers) # Interaction comet ICloudMgrComet.__init__(self) IDynamicComponentProvider.__init__(self) IDomTree.__init__( self, dom_storage=dom_storage, dom_father=dom_father, ) @with_cloudmap_resolver(self) def get_cloudmap_in_a_list(*args, **kwargs): result = kwargs['with_cloudmap_resolver'].cloudmap.copy() return [result] def get_list_from_attribute(l, attribute=None): l_result = [] for e in l: result = [] if getattr(self, attribute) and getattr(self, attribute) <> '*': result = e.get(getattr(self, attribute), []) else: result = e.values() if type(result) == dict: result = [result] l_result.extend(result) return l_result def print_struct(x): pprint(x) print return x def sum_element_on_list(l): result = 0 for e in l: result = result + len(e) return result SequentialOps.__init__(self, self.cloudmap_resolver, [ get_cloudmap_in_a_list, lambda l, attribute='aera': get_list_from_attribute(l, attribute), lambda l, attribute='appcode': get_list_from_attribute( l, attribute), lambda l, attribute='env': get_list_from_attribute(l, attribute), lambda l, attribute='appcomp': get_list_from_attribute( l, attribute), sum_element_on_list, ])