# --- minimal analysis information settings = ProcessManager().service(ConfigObject) settings['analysisName'] = 'esk101_helloworld' settings['version'] = 0 ######################################################################################### # --- Analysis values, settings, helper functions, configuration flags. # E.g. define flags turn on or off certain chains with links. # by default all set to false, unless already configured in # configobject or vars() settings['do_hello'] = True settings['n_repeat'] = 2 ######################################################################################### # --- now set up the chains and links based on configuration flags proc_mgr = ProcessManager() if settings['do_hello']: ch = proc_mgr.add_chain('Hello') link = core_ops.HelloWorld(name='HelloWorld') link.set_log_level(logging.DEBUG) link.repeat = settings['n_repeat'] ch.add_link(link) ######################################################################################### log.debug('Done parsing configuration file esk101_helloworld')
The two flags below control whether chains are turned on or off. (default=on) from the cmd line, control these with: -c do_chain0=False -c do_chain1=False Try it; No Hello Worlds will be printed. """ log.info(msg) ######################################################################################### # --- now set up the chains and links based on configuration flags proc_mgr = ProcessManager() if settings.get('do_chain0', True): ch = proc_mgr.add_chain('Chain0') link = core_ops.HelloWorld(name='hello0') link.hello = 'Town' ch.add_link(link) if settings.get('do_chain1', True): ch = proc_mgr.add_chain('Chain1') link = core_ops.HelloWorld(name='hello1') link.hello = 'Universe' ch.add_link(link) ######################################################################################### log.debug('Done parsing configuration file esk106_cmdline_options')