(module)
Initialize a module and load it into the global HOUSE
        variable.  MODULE should be an instance of the loaded
        module.
Initialize a module and load it into the global HOUSE
        variable.  MODULE should be an instance of the loaded
        module.
Initialize a module and load it into the global HOUSE variable . MODULE should be an instance of the loaded module .
def initialize(module):
    """ Initialize a module and load it into the global HOUSE
        variable.  MODULE should be an instance of the loaded
        module.
    """
    global HOUSE
    debug("Received module start for: %s" % (module.__name__))
    if not 'service' in HOUSE:
        # services will always be 0
        HOUSE['service'] = {}

    tmp_mod = module()
    # option management interface; i.e. if we need to
    # load into another menu
    if not tmp_mod.skip_opts:
        response = handle_opts(tmp_mod)
    else:
        response = True

    if response:
        if hasattr(tmp_mod, 'initialize_bg'):
            tmp = tmp_mod.initialize_bg()
        else:
            tmp = tmp_mod.initialize()
    else:
        return

    if tmp is not None and tmp is not False:
        if isinstance(tmp_mod, Service):
            HOUSE['service'][tmp_mod.which] = tmp_mod
            return

        if not tmp_mod.which in HOUSE:
            HOUSE[tmp_mod.which] = {}
        HOUSE[tmp_mod.which][tmp_mod.session_view()] = tmp_mod
def initialize ( module ) : global HOUSE debug ( "Received module start for: %s" % ( module . __name__ ) ) if not 'service' in HOUSE : # services will always be 0 HOUSE [ 'service' ] = { } tmp_mod = module ( ) # option management interface; i.e. if we need to # load into another menu if not tmp_mod . skip_opts : response = handle_opts ( tmp_mod ) else : response = True if response : if hasattr ( tmp_mod , 'initialize_bg' ) : tmp = tmp_mod . initialize_bg ( ) else : tmp = tmp_mod . initialize ( ) else : return if tmp is not None and tmp is not False : if isinstance ( tmp_mod , Service ) : HOUSE [ 'service' ] [ tmp_mod . which ] = tmp_mod return if not tmp_mod . which in HOUSE : HOUSE [ tmp_mod . which ] = { } HOUSE [ tmp_mod . which ] [ tmp_mod . session_view ( ) ] = tmp_mod