From b638466e6a6ada7478758cf740c89650d0f70f59 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Fri, 19 Jan 2024 03:07:54 +0100 Subject: WIP plenty of clean-ups and porting to Python 3. --- interfaces/email/interactive/send_pgp_mime.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'interfaces') diff --git a/interfaces/email/interactive/send_pgp_mime.py b/interfaces/email/interactive/send_pgp_mime.py index e0ffbd5..42a0a8c 100644 --- a/interfaces/email/interactive/send_pgp_mime.py +++ b/interfaces/email/interactive/send_pgp_mime.py @@ -142,7 +142,7 @@ def header_from_text(text, encoding="us-ascii"): """ Simple wrapper for instantiating an email.Message from text. >>> header = header_from_text('\\n'.join(['From: me@big.edu','To: you@big.edu','Subject: testing'])) - >>> print flatten(header) + >>> print(flatten(header)) From: me@big.edu To: you@big.edu Subject: testing @@ -192,7 +192,7 @@ def attach_root(header, root_part): """ for k,v in list(header.items()): root_part[k] = v - return root_part + return root_part def execute(args, stdin=None, expect=(0,)): """ @@ -286,7 +286,7 @@ class PGPMimeMessageFactory (object): >>> target_emails(header) == [to_addr] True >>> m = PGPMimeMessageFactory('check 1 2\\ncheck 1 2\\n') - >>> print flatten(m.clearBodyPart()) + >>> print(flatten(m.clearBodyPart())) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit @@ -295,7 +295,7 @@ class PGPMimeMessageFactory (object): check 1 2 check 1 2 - >>> print flatten(m.plain()) + >>> print(flatten(m.plain())) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit @@ -305,7 +305,7 @@ class PGPMimeMessageFactory (object): >>> signed = m.sign(header) >>> signed.set_boundary('boundsep') - >>> print flatten(signed).replace('\\t', ' '*4) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE + >>> print(flatten(signed).replace('\\t', ' '*4) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="boundsep" MIME-Version: 1.0 @@ -334,7 +334,7 @@ class PGPMimeMessageFactory (object): --boundsep-- >>> encrypted = m.encrypt(header) >>> encrypted.set_boundary('boundsep') - >>> print flatten(encrypted).replace('\\t', ' '*4) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE + >>> print(flatten(encrypted).replace('\\t', ' '*4) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE) Content-Type: multipart/encrypted; protocol="application/pgp-encrypted"; micalg="pgp-sha1"; boundary="boundsep" @@ -360,7 +360,7 @@ class PGPMimeMessageFactory (object): --boundsep-- >>> signedAndEncrypted = m.signAndEncrypt(header) >>> signedAndEncrypted.set_boundary('boundsep') - >>> print flatten(signedAndEncrypted).replace('\\t', ' '*4) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE + >>> print(flatten(signedAndEncrypted).replace('\\t', ' '*4) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE) Content-Type: multipart/encrypted; protocol="application/pgp-encrypted"; micalg="pgp-sha1"; boundary="boundsep" -- cgit