From: Tomi Ollila <tomi.ollila@iki.fi>
To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,
Notmuch Mail <notmuch@notmuchmail.org>
Subject: Re: [PATCH] Drop devel/printmimestructure (it is in mailscripts 0.11)
Date: Sun, 15 Sep 2019 21:18:04 +0300 [thread overview]
Message-ID: <m28sqps9sz.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <20190915180203.26426-1-dkg@fifthhorseman.net>
On Sun, Sep 15 2019, Daniel Kahn Gillmor wrote:
> mailscripts 0.11 now ships a derivative of devel/printmimestructure
> called email-print-mime-structure. Maintenance for that utility will
> happen in mailscripts from now on, so we should not track an
> independent copy of it in notmuch's source tree.
So only for debian users >;)
(I downloaded the package from packages.debian.org couple of hours ago,
manually, as package damager in this system did not find it.)
I'm fine dropping this, just that helping users to download the tool
might be a bit harder now ?
Tomi
>
> See https://bugs.debian.org/939993 for more details about the
> adoption.
>
> Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
> ---
> devel/printmimestructure | 69 ----------------------------------------
> 1 file changed, 69 deletions(-)
> delete mode 100755 devel/printmimestructure
>
> diff --git a/devel/printmimestructure b/devel/printmimestructure
> deleted file mode 100755
> index 70e0a5c0..00000000
> --- a/devel/printmimestructure
> +++ /dev/null
> @@ -1,69 +0,0 @@
> -#!/usr/bin/env python
> -# -*- coding: utf-8 -*-
> -
> -# Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
> -# License: GPLv3+
> -
> -# This script reads a MIME message from stdin and produces a treelike
> -# representation on it stdout.
> -
> -# Example:
> -#
> -# 0 dkg@alice:~$ printmimestructure < 'Maildir/cur/1269025522.M338697P12023.monkey,S=6459,W=6963:2,Sa'
> -# └┬╴multipart/signed 6546 bytes
> -# ├─╴text/plain inline 895 bytes
> -# └─╴application/pgp-signature inline [signature.asc] 836 bytes
> -# 0 dkg@alice:~$
> -
> -
> -# If you want to number the parts, i suggest piping the output through
> -# something like "cat -n"
> -
> -from __future__ import print_function
> -
> -import email
> -import sys
> -
> -def print_part(z, prefix):
> - fname = '' if z.get_filename() is None else ' [' + z.get_filename() + ']'
> - cset = '' if z.get_charset() is None else ' (' + z.get_charset() + ')'
> - disp = z.get_params(None, header='Content-Disposition')
> - if (disp is None):
> - disposition = ''
> - else:
> - disposition = ''
> - for d in disp:
> - if d[0] in [ 'attachment', 'inline' ]:
> - disposition = ' ' + d[0]
> - if z.is_multipart():
> - nbytes = len(z.as_string())
> - else:
> - nbytes = len(z.get_payload())
> -
> - print('{}{}{}{}{} {:d} bytes'.format(
> - prefix,
> - z.get_content_type(),
> - cset,
> - disposition,
> - fname,
> - nbytes,
> - ))
> -
> -def test(z, prefix=''):
> - if (z.is_multipart()):
> - print_part(z, prefix+'┬╴')
> - if prefix.endswith('└'):
> - prefix = prefix.rpartition('└')[0] + ' '
> - if prefix.endswith('├'):
> - prefix = prefix.rpartition('├')[0] + '│'
> - parts = z.get_payload()
> - i = 0
> - while (i < parts.__len__()-1):
> - test(parts[i], prefix + '├')
> - i += 1
> - test(parts[i], prefix + '└')
> - # FIXME: show epilogue?
> - else:
> - print_part(z, prefix+'─╴')
> -
> -test(email.message_from_file(sys.stdin), '└')
> --
> 2.23.0
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
next prev parent reply other threads:[~2019-09-15 18:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-15 18:02 [PATCH] Drop devel/printmimestructure (it is in mailscripts 0.11) Daniel Kahn Gillmor
2019-09-15 18:18 ` Tomi Ollila [this message]
2019-09-15 21:06 ` David Bremner
2019-10-13 12:43 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m28sqps9sz.fsf@guru.guru-group.fi \
--to=tomi.ollila@iki.fi \
--cc=dkg@fifthhorseman.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).