X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b4fd2ab4e409e36f894c1fb27144e4fa2854f389..1c434a9f9ec70d8f23583bc737a516c3ef0eb91d:/doc/_includes/_events_py.liquid diff --git a/doc/_includes/_events_py.liquid b/doc/_includes/_events_py.liquid index 3f6f40f929..5662440b0e 100644 --- a/doc/_includes/_events_py.liquid +++ b/doc/_includes/_events_py.liquid @@ -2,15 +2,12 @@ import arvados import arvados.events -import json # 'ev' is a dict containing the log table record describing the change. def on_message(ev): - if ('event_type' in ev and - ev['event_type'] == 'create' and - ev["object_kind"] == "arvados#collection"): - print "A new collection was created %s" % ev['object_uuid'] + if ev.get("event_type") == "create" and ev.get("object_kind") == "arvados#collection": + print "A new collection was created: %s" % ev["object_uuid"] -api = arvados.api('v1', cache=False) +api = arvados.api("v1") ws = arvados.events.subscribe(api, [], on_message) ws.run_forever()