Example #1
0
def componentmodule( category, type ):
    '''obtain the python module for the given category and type
Examples:
  componentmodule( 'monitors', 'E_monitor' )
  '''
    f = componentfactory( category, type )
    return __import__( f.__module__, {}, {}, [''] )
Example #2
0
def componentmodule(category, type):
    '''obtain the python module for the given category and type
Examples:
  componentmodule( 'monitors', 'E_monitor' )
  '''
    f = componentfactory(category, type)
    return __import__(f.__module__, {}, {}, [''])
Example #3
0
def componentfactory( category, type ):
    '''obtain component factory method of given category and type
Examples:
  componentfactory( 'monitors', 'E_monitor' )
  '''
    from components import componentfactory
    from components.Registry import NotRegisteredError
    try: f = componentfactory( category, type )
    except NotRegisteredError: f = defaultcomponentfactory( category, type )
    return f
Example #4
0
def componentfactory(category, type):
    '''obtain component factory method of given category and type
Examples:
  componentfactory( 'monitors', 'E_monitor' )
  '''
    from components import componentfactory
    from components.Registry import NotRegisteredError
    try:
        f = componentfactory(category, type)
    except NotRegisteredError:
        f = defaultcomponentfactory(category, type)
    return f
Example #5
0
def defaultcomponentfactory( category, type ):
    path = defaultcomponentpath( category, type )
    wrapcomponent( path, category )
    from components import componentfactory
    return componentfactory( category, type )
Example #6
0
def defaultcomponentfactory(category, type):
    path = defaultcomponentpath(category, type)
    wrapcomponent(path, category)
    from components import componentfactory
    return componentfactory(category, type)