mirror of https://github.com/zulip/zulip.git
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)
This commit is contained in:
parent
a87ac2dec9
commit
7aaa08d9b2
|
@ -134,7 +134,7 @@ def ensure_subscribed(sub):
|
||||||
if sub in current_zephyr_subs:
|
if sub in current_zephyr_subs:
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
subs.add((sub, '*', '*'))
|
zephyr.Subscriptions().add((sub, '*', '*'))
|
||||||
except IOError:
|
except IOError:
|
||||||
# Since we haven't added the subscription to
|
# Since we haven't added the subscription to
|
||||||
# current_zephyr_subs yet, we can just return (so that we'll
|
# 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):
|
def zephyr_subscribe_autoretry(sub):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
subs.add(sub)
|
zephyr.Subscriptions().add(sub)
|
||||||
return
|
return
|
||||||
except IOError:
|
except IOError:
|
||||||
# Probably a SERVNAK from the zephyr server, but print the
|
# 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
|
import zephyr
|
||||||
zephyr.init()
|
zephyr.init()
|
||||||
subs = zephyr.Subscriptions()
|
|
||||||
zephyr_to_humbug(options)
|
zephyr_to_humbug(options)
|
||||||
|
|
Loading…
Reference in New Issue