#!/usr/bin/env python import argparse import sys parser = argparse.ArgumentParser() parser.add_argument('-u', '--uuid', type=str, default="") args = parser.parse_args() def on_message(ev): print "\n", ev filters = [] if len(args.uuid)>0: filter1 = [] filter1.append ('object_uuid') filter1.append ('=') filter1.append (args.uuid) filters.append (filter1) import arvados from arvados.events import subscribe api = arvados.api('v1', cache=False) ws = None try: ws = subscribe(api, filters, lambda ev: on_message(ev)) ws.run_forever() except: if (ws): ws.close_connection() else: sys.exc_info()