From 43b9510abddfbf4493be2d2245e1565beee1d416 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 7 Nov 2012 14:55:30 -0500 Subject: [PATCH] zephyr_mirror: Eliminate the confusing "subs" global. zephyr.Subscriptions() is a singleton class, intended to be accessed as it is used. (imported from commit f76c1b1129adb19ba96ed17f441492edf859a748) --- bots/zephyr_mirror.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bots/zephyr_mirror.py b/bots/zephyr_mirror.py index 1204f24..110a8f9 100755 --- a/bots/zephyr_mirror.py +++ b/bots/zephyr_mirror.py @@ -134,7 +134,7 @@ def ensure_subscribed(sub): if sub in current_zephyr_subs: return try: - subs.add((sub, '*', '*')) + zephyr.Subscriptions().add((sub, '*', '*')) except IOError: # Since we haven't added the subscription to # current_zephyr_subs yet, we can just return (so that we'll @@ -291,7 +291,7 @@ def decode_unicode_byte_strings(zeph): def zephyr_subscribe_autoretry(sub): while True: try: - subs.add(sub) + zephyr.Subscriptions().add(sub) return except IOError: # Probably a SERVNAK from the zephyr server, but print the @@ -657,5 +657,4 @@ or specify the --api-key-file option.""" % (options.api_key_file,))) import zephyr zephyr.init() - subs = zephyr.Subscriptions() zephyr_to_humbug(options)