Exemple #1
0
def main(argv=None):
    # Figure out where Yuno lives so plugins can cd correctly if they need to.
    yuno_home = os.path.abspath(os.path.dirname(__file__))
    setattr(config.config, 'YUNO_HOME', yuno_home)

    with working_dir(yuno_home):
        config.load_default()
        options, parser = cli.get_cli_args(argv or sys.argv[1:])
        program = __import__('yuno.%s.%s' % (options.command, options.command),
                             fromlist=['yuno.%s' % options.command])

        program.main(options.tail)
Exemple #2
0
def main(argv=None):
    # Figure out where Yuno lives so plugins can cd correctly if they need to.
    yuno_home = os.path.abspath(os.path.dirname(__file__))
    setattr(config.config, 'YUNO_HOME', yuno_home)

    with working_dir(yuno_home):
        config.load_default()
        options, parser = cli.get_cli_args(argv or sys.argv[1:])
        program = __import__(
            'yuno.%s.%s' % (options.command, options.command),
            fromlist=['yuno.%s' % options.command]
        )

        program.main(options.tail)
Exemple #3
0
def load_settings(runtime_settings, plugin_name):
    plugin_name = re.sub('[^a-z0-9_]', '', plugin_name, flags=re.I)
    plugin_settings_file = 'yuno/%s/settings/config.json' % plugin_name

    config.load_default()

    if os.path.isfile(plugin_settings_file):
        config.load_json(plugin_settings_file)

    for override in runtime_settings or []:
        key = override[0]
        if isinstance(getattr(config.config, key), list):
            value = override[1:]
        else:
            value = override[1]
        config.update(key, value)
Exemple #4
0
def load_settings(runtime_settings, plugin_name):
    plugin_name = re.sub('[^a-z0-9_]', '', plugin_name, flags=re.I)
    plugin_settings_file = 'yuno/%s/settings/config.json' % plugin_name

    config.load_default()

    if os.path.isfile(plugin_settings_file):
        config.load_json(plugin_settings_file)

    for override in runtime_settings or []:
        key = override[0]
        if isinstance(getattr(config.config, key), list):
            value = override[1:]
        else:
            value = override[1]
        config.update(key, value)