def receive(self, message=""): """Receive email message (read it from stdin)""" if not message: message = sys.stdin.read() email_message = parse_email(message) sender = email_message["from"][1] body = email_message["body"][0] if sender and body: return Message.from_raw(sender, self.encoder.decode(body.encode("ascii")))
def receive(self, message=''): """Receive email message (read it from stdin)""" if not message: message = sys.stdin.read() email_message = parse_email(message) sender = email_message['from'][1] body = email_message['body'][0] if sender and body: return Message.from_raw(sender, self.encoder.decode(body.encode('ascii')))
def receive(self, message=""): """Receive message (read it from terminal)""" if not message: print("RECEIVE:") sender = input("From: ") body = input("Encrypted message: ") print() else: sender, body = message.strip().split(None, maxsplit=1) if sender and body: return Message.from_raw(sender, self.encoder.decode(body.encode("ascii")))
def receive(self, message=''): """Receive message (read it from terminal)""" if not message: print('RECEIVE:') sender = input('From: ') body = input('Encrypted message: ') print() else: sender, body = message.strip().split(None, maxsplit=1) if sender and body: return Message.from_raw(sender, self.encoder.decode(body.encode('ascii')))