コード例 #1
0
ファイル: email.py プロジェクト: xmikos/pyxolotl
    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")))
コード例 #2
0
ファイル: email.py プロジェクト: xmikos/pyxolotl
    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')))
コード例 #3
0
ファイル: plaintext.py プロジェクト: xmikos/pyxolotl
    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")))
コード例 #4
0
    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')))