From: Andrew Engelbrecht Date: Sat, 18 Jul 2015 21:23:56 +0000 (-0400) Subject: removed a function, changed a func name X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=65ed3800011c7aca15b1ca146f04f5552b3f1ca4;p=edward.git removed a function, changed a func name the removed function will eventually be replaced by a reply generation function. --- diff --git a/edward-bot b/edward-bot index 1a7ffbf..76c3758 100755 --- a/edward-bot +++ b/edward-bot @@ -41,27 +41,18 @@ def main (): handle_args() email_text = sys.stdin.read() - message, keys = decode_simplify_email(email_text) - print(message) + plaintext, keys = email_decode_flatten (email_text) + email_from, email_subject = email_from_subject(email_text) + + print("From: " + email_from) + print("Subject: " + email_subject) + print(plaintext) for key in keys: print(key.subkeys[0].fpr) -def decode_simplify_email (email_text): - - plaintext, keys = email_decode_flatten(email_text) - - email_from, email_subject = get_from_subject(email_text) - - simplified_msg = "From: " + email_from + "\n" - simplified_msg += "Subject: " + email_subject + "\n\n" - simplified_msg += plaintext - - return simplified_msg, keys - - def email_decode_flatten (email_text): body = "" @@ -104,7 +95,7 @@ def email_decode_flatten (email_text): return body, keys -def get_from_subject (email_text): +def email_from_subject (email_text): email_struct = email.parser.Parser().parsestr(email_text)