示例#1
0
文件: __init__.py 项目: mcvine/mcvine
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__, {}, {}, [''] )
示例#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__, {}, {}, [''])
示例#3
0
文件: __init__.py 项目: mcvine/mcvine
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
示例#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
示例#5
0
文件: __init__.py 项目: mcvine/mcvine
def defaultcomponentfactory( category, type ):
    path = defaultcomponentpath( category, type )
    wrapcomponent( path, category )
    from components import componentfactory
    return componentfactory( category, type )
示例#6
0
def defaultcomponentfactory(category, type):
    path = defaultcomponentpath(category, type)
    wrapcomponent(path, category)
    from components import componentfactory
    return componentfactory(category, type)