Пример #1
0
 def create_harvest_job(self):
     if len(self.args) >= 2:
         source_id_or_name = unicode(self.args[1])
     else:
         print("Please provide a source id")
         sys.exit(1)
     print(utils.create_job(source_id_or_name))
Пример #2
0
def job(ctx, id):
    """Create new harvest job and runs it (puts it on the gather queue).

    """
    flask_app = ctx.meta["flask_app"]
    with flask_app.test_request_context():
        try:
            result = utils.create_job(id)
        except HarvestJobExists as e:
            tk.error_shout(e)
            ctx.abort()
    click.echo(result)