From e5df7b289c3b780eb2357eb243920c77c22c40ac Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 2 Nov 2012 16:41:04 -0400 Subject: [PATCH] zephyr_mirror: Rename humbug_username to to_humbug_username. (imported from commit 764673b9ccf2f58f88e1d6eec173a1c49ac15cad) --- api/bots/zephyr_mirror.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/bots/zephyr_mirror.py b/api/bots/zephyr_mirror.py index a774690f60..e448c25591 100755 --- a/api/bots/zephyr_mirror.py +++ b/api/bots/zephyr_mirror.py @@ -78,7 +78,7 @@ humbug_client = api.common.HumbugAPI(email=options.user + "@mit.edu", start_time = time.time() -def humbug_username(zephyr_username): +def to_humbug_username(zephyr_username): return zephyr_username.lower().split("@")[0] + "@mit.edu" def unwrap_lines(body): @@ -89,7 +89,7 @@ def unwrap_lines(body): def send_humbug(zeph): if options.forward_class_messages: zeph["forged"] = "yes" - zeph["sender"] = humbug_username(zeph["sender"]) + zeph["sender"] = to_humbug_username(zeph["sender"]) zeph['fullname'] = username_to_fullname(zeph['sender']) zeph['shortname'] = zeph['sender'].split('@')[0] if "subject" in zeph: @@ -234,7 +234,7 @@ def process_notice(notice, log): if body.startswith("CC:"): is_huddle = True # Map "CC: sipbtest espuser" => "starnine@mit.edu,espuser@mit.edu" - huddle_recipients_list = [humbug_username(x.strip()) for x in + huddle_recipients_list = [to_humbug_username(x.strip()) for x in body.split("\n")[0][4:].split()] if sender not in huddle_recipients_list: huddle_recipients_list.append(sender) @@ -260,7 +260,7 @@ def process_notice(notice, log): zeph = { 'type' : 'personal', 'time' : str(notice.time), 'sender' : sender, - 'recipient' : humbug_username(recipient), + 'recipient' : to_humbug_username(recipient), 'zsig' : zsig, # logged here but not used by app 'content' : body } else: