本文整理匯總了Python中util.ComponentRegistry.initRegistry方法的典型用法代碼示例。如果您正苦於以下問題:Python ComponentRegistry.initRegistry方法的具體用法?Python ComponentRegistry.initRegistry怎麽用?Python ComponentRegistry.initRegistry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類util.ComponentRegistry
的用法示例。
在下文中一共展示了ComponentRegistry.initRegistry方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setUp
# 需要導入模塊: from util import ComponentRegistry [as 別名]
# 或者: from util.ComponentRegistry import initRegistry [as 別名]
def setUp(self):
compReg.initRegistry()
# add a test registry
self.behavior1 = EchoBehavior({'Id': 'behavior1'})
self.behavior2 = DebugBehavior({'Id': 'behavior2'})
compReg.registerComponent(self.behavior1)
compReg.registerComponent(self.behavior2)
self.switchBehavior = SwitchBehavior({'Id': 'switch', 'PrefixToBehavior': '{"@": "behavior1", "#": "behavior2"}', 'DefaultBehavior': 'behavior1'})
compReg.registerComponent(self.switchBehavior)
示例2: __init__
# 需要導入模塊: from util import ComponentRegistry [as 別名]
# 或者: from util.ComponentRegistry import initRegistry [as 別名]
def __init__(self, configFileName):
main_log.info("System Initialization began based on: " + str(configFileName))
self.timer = clock.Stopwatch()
self.timer.start()
self.inputs = {} # dict of inputs and their bound behaviors, keyed by InputId
self.behaviors = {}
self.lock = thread.allocate_lock()
self.behaviorOutputs = {} # key: [list of output destinations]
self.behaviorInputs = {}
self.componentDict = {}
self.inputBehaviorRegistry = {} # inputid -> behaviors listening to that
self.dieNow = False
# input
self.screen = Screen()
compReg.initRegistry()
compReg.registerComponent(self.screen, "Screen") # TODO: move to constants file
bqs.initBQS() # initialize the behavior query system
# read configs from xml
config = configGetter.loadConfigFile(configFileName)
rendererConfig = config.find("RendererConfiguration")
self.initializeRenderers(rendererConfig)
pixelConfig = config.find("PixelConfiguration")
self.initializeScreen(pixelConfig)
inputConfig = config.find("InputConfiguration")
self.initializeInputs(inputConfig)
behaviorConfig = config.find("BehaviorConfiguration")
self.initializeBehaviors(behaviorConfig)
mapperConfig = config.find("PixelMapperConfiguration")
self.initializeMapper(mapperConfig)
# inits
main_log.info("All components initialized")
#
self.registerAllComponents()
installationConfig = config.find("InstallationConfiguration")
self.configureInstallation(installationConfig)
# Done initializing. Lets start this thing!
self.timer.stop()
# main_log.info('Initialization done. Time: ', self.timer.elapsed(), 'ms')
self.mainLoop()
示例3: setUp
# 需要導入模塊: from util import ComponentRegistry [as 別名]
# 或者: from util.ComponentRegistry import initRegistry [as 別名]
def setUp(self):
compReg.initRegistry()