Ejemplo n.º 1
0
        opt_task_name_pos, opt_check_spec_pos,
        opt_no_temporary, opt_temporary,
        opt_filter_records, opt_filter_pattern,
        # opt_consider_deleted_records, opt_no_consider_deleted_records,
        opt_arguments,
        opt_schedule, opt_schedule_disable, opt_schedule_enable,
    )

    def run(self, **options):
        """
        Creates a new rule.
        """
        options['name'] = options.pop('task_name_pos')
        create_task(options)

manager.add_command('create-task', CreateTask())


class BranchTask(Command):

    option_list = (
        opt_task_name_pos,
        opt_task_name,
        opt_check_spec,
        opt_no_temporary, opt_temporary,
        opt_filter_records, opt_filter_pattern,
        # opt_consider_deleted_records, opt_no_consider_deleted_records,
        opt_arguments,
        opt_schedule, opt_schedule_disable, opt_schedule_enable,
    )
Ejemplo n.º 2
0
        # opt_consider_deleted_records, opt_no_consider_deleted_records,
        opt_arguments,
        opt_schedule,
        opt_schedule_disable,
        opt_schedule_enable,
    )

    def run(self, **options):
        """
        Creates a new rule.
        """
        options['name'] = options.pop('task_name_pos')
        create_task(options)


manager.add_command('create-task', CreateTask())


class BranchTask(Command):

    option_list = (
        opt_task_name_pos,
        opt_task_name,
        opt_check_spec,
        opt_no_temporary,
        opt_temporary,
        opt_filter_records,
        opt_filter_pattern,
        # opt_consider_deleted_records, opt_no_consider_deleted_records,
        opt_arguments,
        opt_schedule,
Ejemplo n.º 3
0
        new_value = raw_input(prmt)
        try:
            new_value = ast.literal_eval(new_value)
        except (SyntaxError, ValueError):
            pass

        print('>>>', key, '=', pformat(new_value))
        print(key, '=', pformat(new_value), file=new_config)

    with current_app.open_instance_resource(filename, 'w') as config_file:
        config_file.write(new_config.getvalue())


config_create = Manager(usage="Creates variables in config file.")
manager.add_command("create", config_create)


@config_create.command
@change_command_name
def secret_key(key=None, filename='invenio.cfg', silent=True):
    """Generate and append SECRET_KEY to invenio.cfg.

    Useful for the installation process.
    """
    print(">>> Going to generate random SECRET_KEY...")
    try:
        d = get_instance_config_object(filename)
    except Exception as e:
        print("ERROR: ", str(e), file=sys.stderr)
        sys.exit(1)
Ejemplo n.º 4
0
    """
    from invenio_upgrader.commands import cmd_upgrade
    cmd_upgrade()


@manager.command
def check():
    """
    Command for checking upgrades
    """
    from invenio_upgrader.commands import cmd_upgrade_check
    cmd_upgrade_check()


show = Manager(usage="Display pending or applied upgrades.")
manager.add_command("show", show)


@show.command
def pending():
    """
    Command for showing upgrades ready to be applied
    """
    from invenio_upgrader.commands import cmd_upgrade_show_pending
    cmd_upgrade_show_pending()


@show.command
def applied():
    """
    Command for showing all upgrades already applied.