コード例 #1
0
def run(jobname):
    """Send job from queue to the machine."""
    job = _get(jobname)
    if not driveboard.status()['ready']:
        bottle.abort(400, "Machine not ready.")
    driveboard.job(json.loads(job))
    return '{}'
コード例 #2
0
ファイル: web.py プロジェクト: nortd/driveboardapp
def run(jobname):
    """Send job from queue to the machine."""
    job = _get(jobname)
    if not driveboard.status()['ready']:
        bottle.abort(400, "Machine not ready.")
    driveboard.job(json.loads(job))
    return '{}'
コード例 #3
0
def run_direct():
    """Run an dba job directly, by-passing the queue.
    Args:
        (Args come in through the POST request.)
        job: Parsed dba job.
    """
    load_request = json.loads(bottle.request.forms.get('load_request'))
    job = load_request.get('job')  # always a string
    # sanity check
    if job is None:
        bottle.abort(400, "Invalid request data.")
    driveboard.job(json.loads(job))
    return '{}'
コード例 #4
0
ファイル: web.py プロジェクト: nortd/driveboardapp
def run_direct():
    """Run an dba job directly, by-passing the queue.
    Args:
        (Args come in through the POST request.)
        job: Parsed dba job.
    """
    load_request = json.loads(bottle.request.forms.get('load_request'))
    job = load_request.get('job')  # always a string
    # sanity check
    if job is None:
        bottle.abort(400, "Invalid request data.")
    driveboard.job(json.loads(job))
    return '{}'