X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8b7cac2607bda6ace3444ff20917c6262395bd7a..f5bd38d4b168540ddb0e33db9e35a51ec5d60c17:/sdk/python/bin/arv-ws diff --git a/sdk/python/bin/arv-ws b/sdk/python/bin/arv-ws index 58b628145f..4e663cef1b 100755 --- a/sdk/python/bin/arv-ws +++ b/sdk/python/bin/arv-ws @@ -1,30 +1,4 @@ #!/usr/bin/env python -import sys -import logging -import argparse -import arvados -from arvados.events import subscribe - -parser = argparse.ArgumentParser() -parser.add_argument('-u', '--uuid', type=str, default="") -args = parser.parse_args() - -filters = [] -if len(args.uuid)>0: filters = [ ['object_uuid', '=', args.uuid] ] - -api = arvados.api('v1', cache=False) - -def on_message(ev): - print "\n", ev - -ws = None -try: - ws = subscribe(api, filters, lambda ev: on_message(ev)) - ws.run_forever() -except KeyboardInterrupt: - print '' # don't log it -except: - logging.exception('') - if (ws): - ws.close_connection() +from arvados.commands.ws import main +main()