Esempio n. 1
0
    def clear_harvest_source_history(self):
        keep_current = bool(self.options.keep_current)
        source_id = None
        if len(self.args) >= 2:
            source_id = unicode_safe(self.args[1])

        print(utils.clear_harvest_source_history(source_id, keep_current))
Esempio n. 2
0
def clear_history(ctx, id):
    """If no source id is given the history for all harvest sources
    (maximum is 1000) will be cleared.

    Clears all jobs and objects related to a harvest source, but keeps
    the source itself.  The datasets imported from the harvest source
    will NOT be deleted!!!  If a source id is given, it only clears
    the history of the harvest source with the given source id.

    """
    flask_app = ctx.meta["flask_app"]

    with flask_app.test_request_context():
        result = utils.clear_harvest_source_history(id)
    click.secho(result, fg="green")
Esempio n. 3
0
    def clear_harvest_source_history(self):
        source_id = None
        if len(self.args) >= 2:
            source_id = unicode(self.args[1])

        print(utils.clear_harvest_source_history(source_id))
Esempio n. 4
0
    def clear_harvest_source_history(self):
        source_id = None
        if len(self.args) >= 2:
            source_id = six.text_type(self.args[1])

        print(utils.clear_harvest_source_history(source_id))