From 111a9bc0e6a971a9e3a9414e3bfe02ce9543a223 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 26 Nov 2012 14:47:59 -0500 Subject: [PATCH] zephyr_mirror: Refactor zwrite_args handling a bit. (imported from commit 4923c90dc546022d48f226c2a204e9d09717b563) --- bots/zephyr_mirror_backend.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bots/zephyr_mirror_backend.py b/bots/zephyr_mirror_backend.py index 3f14a4c..312ec82 100755 --- a/bots/zephyr_mirror_backend.py +++ b/bots/zephyr_mirror_backend.py @@ -396,6 +396,7 @@ def forward_to_zephyr(message): wrapped_content = "\n".join("\n".join(wrapper.wrap(line)) for line in message["content"].split("\n")) + zwrite_args = ["zwrite", "-s", zsig] logger.info("Forwarding message from %s" % (message["sender_email"],)) if message['type'] == "stream": zephyr_class = message["display_recipient"] @@ -416,12 +417,12 @@ def forward_to_zephyr(message): else: instance = zephyr_class zephyr_class = "message" - zwrite_args = ["zwrite", "-s", zsig, "-c", zephyr_class, "-i", instance] + zwrite_args.extend(["-c", zephyr_class, "-i", instance]) elif message['type'] == "personal": recipient = to_zephyr_username(message["display_recipient"]["email"]) - zwrite_args = ["zwrite", "-s", zsig, recipient] + zwrite_args.extend([recipient]) elif message['type'] == "huddle": - zwrite_args = ["zwrite", "-s", zsig, "-C"] + zwrite_args.extend(["-C"]) zwrite_args.extend([to_zephyr_username(user["email"]).replace("@ATHENA.MIT.EDU", "") for user in message["display_recipient"]])