8784: Fix test for latest firefox.
[arvados.git] / doc / _includes / _events_py.liquid
1 #!/usr/bin/env python
2
3 import arvados
4 import arvados.events
5
6 # 'ev' is a dict containing the log table record describing the change.
7 def on_message(ev):
8     if ev.get("event_type") == "create" and ev.get("object_kind") == "arvados#collection":
9         print "A new collection was created: %s" % ev["object_uuid"]
10
11 api = arvados.api("v1")
12 ws = arvados.events.subscribe(api, [], on_message)
13 ws.run_forever()