def clear_harvest_source(self): if len(self.args) >= 2: source_id_or_name = unicode(self.args[1]) else: print("Please provide a source id") sys.exit(1) utils.clear_harvest_source(source_id_or_name)
def clear(ctx, id): """Clears all datasets, jobs and objects related to a harvest source, but keeps the source itself. """ flask_app = ctx.meta["flask_app"] with flask_app.test_request_context(): utils.clear_harvest_source(id) click.secho("Cleared harvest source: {0}".format(id), fg="green")