def componentinfo(type, category=None, supplier=None): from mcni._find_component import find type, category, supplier = find(type, category=category, supplier=supplier) from mcni import componentinfo return componentinfo(type=type, category=category, supplier=supplier)
def test(self): 'mcni: component factory' from mcni import componentfactory, componentinfo print 'mcni, sources, MonochromaticSource', componentfactory( 'sources', 'MonochromaticSource'), componentinfo( 'sources', 'MonochromaticSource' ) print 'mcni, sources, MonochromaticSource', componentfactory( 'sources', 'MonochromaticSource', 'mcni'), componentinfo( 'sources', 'MonochromaticSource', 'mcni' ) print 'mcstas2, sources, Source_simple', componentfactory( 'sources', 'Source_simple', 'mcstas2'), componentinfo( 'sources', 'Source_simple', 'mcstas2' ) return
def test(self): 'mcni: component factory' print 'mcni, sources, MonochromaticSource', componentfactory( 'sources', 'MonochromaticSource'), componentinfo( 'sources', 'MonochromaticSource' ) print 'mcni, sources, MonochromaticSource', componentfactory( 'sources', 'MonochromaticSource', 'mcni'), componentinfo( 'sources', 'MonochromaticSource', 'mcni' ) return
def test2(self): 'mcni: component factory for mcstas components' import mcstas2 print 'mcstas2, sources, Source_simple', componentfactory( 'sources', 'Source_simple', 'mcstas2'), componentinfo( 'sources', 'Source_simple', 'mcstas2' ) return