From 84aa7d4230c64452136b236c75ab87db47d63ae7 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 6 Aug 2013 15:34:20 -0400 Subject: [PATCH] Change Humbug => Zulip in zephyr_mirror states. (imported from commit 67542cd2ba93ff4b03c99b59645b7d22ed937337) --- bots/zephyr_mirror_backend.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bots/zephyr_mirror_backend.py b/bots/zephyr_mirror_backend.py index 8ce92f8..c09ccfb 100755 --- a/bots/zephyr_mirror_backend.py +++ b/bots/zephyr_mirror_backend.py @@ -73,7 +73,7 @@ class RandomExponentialBackoff(CountingBackoff): DEFAULT_SITE = "https://api.zulip.com" class States: - Startup, HumbugToZephyr, ZephyrToHumbug, ChildSending = range(4) + Startup, ZulipToZephyr, ZephyrToZulip, ChildSending = range(4) CURRENT_STATE = States.Startup def to_humbug_username(zephyr_username): @@ -836,11 +836,11 @@ def parse_args(): return parser.parse_args() def die_gracefully(signal, frame): - if CURRENT_STATE == States.HumbugToZephyr or CURRENT_STATE == States.ChildSending: + if CURRENT_STATE == States.ZulipToZephyr or CURRENT_STATE == States.ChildSending: # this is a child process, so we want os._exit (no clean-up necessary) os._exit(1) - if CURRENT_STATE == States.ZephyrToHumbug: + if CURRENT_STATE == States.ZephyrToZulip: try: # zephyr=>humbug processes may have added subs, so run cancelSubs zephyr._z.cancelSubs() @@ -938,14 +938,14 @@ or specify the --api-key-file option.""" % (options.api_key_file,)))) if options.forward_from_humbug: child_pid = os.fork() if child_pid == 0: - CURRENT_STATE = States.HumbugToZephyr + CURRENT_STATE = States.ZulipToZephyr # Run the humbug => zephyr mirror in the child configure_logger(logger, "humbug=>zephyr") humbug_to_zephyr(options) sys.exit(0) else: child_pid = None - CURRENT_STATE = States.ZephyrToHumbug + CURRENT_STATE = States.ZephyrToZulip import zephyr logger_name = "zephyr=>humbug"