Example #1
0
def clear_jobs(args, config):
    """Clears the job queue"""

    status = args.status
    job_queue = JobQueue(config)
    jobs = job_queue.load_jobs()
    for job in jobs:
        if status is None or status == job.status:
            job.delete()
Example #2
0
def list_jobs(args, config):
    """Lists all jobs in the job queue"""

    status = args.status
    job_queue = JobQueue(config)
    jobs = job_queue.load_jobs()
    for job in jobs:
        if status is None or status == job.status:
            print(f"{job.job_id} {job.status_description}")