actually implement the brozzler-list-jobs --job option

This commit is contained in:
Noah Levitt 2017-03-17 11:14:45 -07:00
parent 0685c77d01
commit 94ba56dca5
2 changed files with 20 additions and 6 deletions

View File

@ -411,8 +411,22 @@ def brozzler_list_jobs():
configure_logging(args)
rr = rethinker(args)
if args.job is not None:
try:
job_id = int(args.job)
except ValueError:
job_id = args.job
reql = rr.table('jobs').get(job_id)
logging.debug('querying rethinkdb: %s', reql)
result = reql.run()
if result:
results = [reql.run()]
else:
logging.error('no such job with id %s', repr(job_id))
sys.exit(1)
else:
reql = rr.table('jobs').order_by('id')
if not args.all:
if args.active:
reql = reql.filter({'status': 'ACTIVE'})
logging.debug('querying rethinkdb: %s', reql)
results = reql.run()

View File

@ -32,7 +32,7 @@ def find_package_data(package):
setuptools.setup(
name='brozzler',
version='1.1b9.dev207',
version='1.1b9.dev208',
description='Distributed web crawling with browsers',
url='https://github.com/internetarchive/brozzler',
author='Noah Levitt',