From 58f4ffe088d6aecd9ff90aebc07b3499f6e22dfd Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 24 Jun 2013 15:32:56 -0400 Subject: [PATCH] [manual] API add_subscriptions: Change arguments to support options. Since in the future we might want requests to add subscriptions to include things like colors, in_home_view, etc., we're changing the data format for the add_subscriptions API call to pass each stream as a dictionary, giving a convenient place to put any added options. The manual step required here is updating the API version in AFS available for use with the zephyr_mirror.py system. (imported from commit 364960cca582a0658f0d334668822045c001b92c) --- bots/zephyr_mirror_backend.py | 2 +- examples/subscribe | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bots/zephyr_mirror_backend.py b/bots/zephyr_mirror_backend.py index c01f7bd..419affa 100755 --- a/bots/zephyr_mirror_backend.py +++ b/bots/zephyr_mirror_backend.py @@ -675,7 +675,7 @@ def add_humbug_subscriptions(verbose): zephyr_subscriptions.add(cls) if len(zephyr_subscriptions) != 0: - res = humbug_client.add_subscriptions(list(zephyr_subscriptions)) + res = humbug_client.add_subscriptions(list({"name": stream} for stream in zephyr_subscriptions)) if res.get("result") != "success": logger.error("Error subscribing to streams:\n%s" % (res["msg"],)) return diff --git a/examples/subscribe b/examples/subscribe index 14b8931..6b4381c 100755 --- a/examples/subscribe +++ b/examples/subscribe @@ -48,4 +48,5 @@ if options.streams == "": print >>sys.stderr, "Usage:", parser.usage sys.exit(1) -print client.add_subscriptions(options.streams.split()) +print client.add_subscriptions([{"name": stream_name} for stream_name in + options.streams.split()])