removed a function, changed a func name
authorAndrew Engelbrecht <andrew@localhost.localdomain>
Sat, 18 Jul 2015 21:23:56 +0000 (17:23 -0400)
committerAndrew Engelbrecht <sudoman@ninthfloor.org>
Mon, 7 Dec 2015 17:46:48 +0000 (12:46 -0500)
the removed function will eventually be replaced by a reply generation
function.

edward-bot

index 1a7ffbf25ecac63194fbcf9b1448e528bcf7be0a..76c375870e21c43db0dbf2004ab305bfd5c15070 100755 (executable)
@@ -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)