예제 #1
0
def initialize_environment_gui(gui_config=None, runtime_config=None):

    from rafcon.gui.config import global_gui_config
    from rafcon.gui.runtime_config import global_runtime_config
    global GUI_INITIALIZED

    if GUI_INITIALIZED:
        raise DeprecationWarning("Deprecated use of environment initialization. The gui was already initialized.")

    # initialize global gui config
    if isinstance(gui_config, tuple) and exists(join(gui_config[1], gui_config[0])):
        global_gui_config.load(gui_config[1], gui_config[0])
    else:
        global_gui_config.load(path=RAFCON_TEMP_PATH_CONFIGS)
        if isinstance(gui_config, dict):
            for key, value in gui_config.items():
                global_gui_config.set_config_value(key, value)

    # initialize global runtime config
    if isinstance(runtime_config, tuple) and exists(join(runtime_config[1], runtime_config[0])):
        global_runtime_config.load(runtime_config[1], runtime_config[0])
    else:
        global_runtime_config.load(path=RAFCON_TEMP_PATH_CONFIGS)
        if isinstance(runtime_config, dict):
            for key, value in runtime_config.items():
                global_runtime_config.set_config_value(key, value)

    GUI_INITIALIZED = True
예제 #2
0
 def on_log_button_toggled(self, log_button, config_key):
     gui_config.set_config_value(config_key, log_button.get_active())