diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2024-01-19 03:07:54 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2024-01-21 21:57:15 +0100 |
commit | b638466e6a6ada7478758cf740c89650d0f70f59 (patch) | |
tree | f34979881a12818ba46a4b74a7a7096e737e441a /interfaces/email/interactive/send_pgp_mime.py | |
parent | b11b63156666589ec9749fa318fe7ecd9d1f136d (diff) | |
download | bugseverywhere-b638466e6a6ada7478758cf740c89650d0f70f59.tar.gz |
WIP plenty of clean-ups and porting to Python 3.
Diffstat (limited to 'interfaces/email/interactive/send_pgp_mime.py')
-rw-r--r-- | interfaces/email/interactive/send_pgp_mime.py | 14 |
1 files changed, 7 insertions, 7 deletions
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 <BLANKLINE> - >>> 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): <BLANKLINE> >>> 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" |