mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-06-16 10:59:12 -04:00
actually implement the brozzler-list-jobs --job option
This commit is contained in:
parent
0685c77d01
commit
94ba56dca5
2 changed files with 20 additions and 6 deletions
|
@ -411,11 +411,25 @@ def brozzler_list_jobs():
|
||||||
configure_logging(args)
|
configure_logging(args)
|
||||||
|
|
||||||
rr = rethinker(args)
|
rr = rethinker(args)
|
||||||
reql = rr.table('jobs').order_by('id')
|
if args.job is not None:
|
||||||
if not args.all:
|
try:
|
||||||
reql = reql.filter({'status': 'ACTIVE'})
|
job_id = int(args.job)
|
||||||
logging.debug('querying rethinkdb: %s', reql)
|
except ValueError:
|
||||||
results = reql.run()
|
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 args.active:
|
||||||
|
reql = reql.filter({'status': 'ACTIVE'})
|
||||||
|
logging.debug('querying rethinkdb: %s', reql)
|
||||||
|
results = reql.run()
|
||||||
if args.yaml:
|
if args.yaml:
|
||||||
yaml.dump_all(
|
yaml.dump_all(
|
||||||
results, stream=sys.stdout, explicit_start=True,
|
results, stream=sys.stdout, explicit_start=True,
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -32,7 +32,7 @@ def find_package_data(package):
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name='brozzler',
|
name='brozzler',
|
||||||
version='1.1b9.dev207',
|
version='1.1b9.dev208',
|
||||||
description='Distributed web crawling with browsers',
|
description='Distributed web crawling with browsers',
|
||||||
url='https://github.com/internetarchive/brozzler',
|
url='https://github.com/internetarchive/brozzler',
|
||||||
author='Noah Levitt',
|
author='Noah Levitt',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue