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__, {}, {}, [''] )
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__, {}, {}, [''])
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
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
def defaultcomponentfactory( category, type ): path = defaultcomponentpath( category, type ) wrapcomponent( path, category ) from components import componentfactory return componentfactory( category, type )
def defaultcomponentfactory(category, type): path = defaultcomponentpath(category, type) wrapcomponent(path, category) from components import componentfactory return componentfactory(category, type)