From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id D12466DE02C5 for ; Sun, 15 Sep 2019 11:18:09 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.409 X-Spam-Level: X-Spam-Status: No, score=0.409 tagged_above=-999 required=5 tests=[AWL=-0.243, SPF_NEUTRAL=0.652] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8p8-fgqwmxSJ for ; Sun, 15 Sep 2019 11:18:08 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 6BC466DE028C for ; Sun, 15 Sep 2019 11:18:08 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id A57E41000E1; Sun, 15 Sep 2019 21:18:04 +0300 (EEST) From: Tomi Ollila To: Daniel Kahn Gillmor , Notmuch Mail Subject: Re: [PATCH] Drop devel/printmimestructure (it is in mailscripts 0.11) In-Reply-To: <20190915180203.26426-1-dkg@fifthhorseman.net> References: <20190915180203.26426-1-dkg@fifthhorseman.net> User-Agent: Notmuch/0.28.3+84~g41389bb (https://notmuchmail.org) Emacs/25.2.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Sep 2019 18:18:09 -0000 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 > --- > 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 > -# 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.M338697P12= 023.monkey,S=3D6459,W=3D6963:2,Sa' > -# =E2=94=94=E2=94=AC=E2=95=B4multipart/signed 6546 bytes > -# =E2=94=9C=E2=94=80=E2=95=B4text/plain inline 895 bytes > -# =E2=94=94=E2=94=80=E2=95=B4application/pgp-signature inline [signatur= e.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 =3D '' if z.get_filename() is None else ' [' + z.get_filename(= ) + ']' > - cset =3D '' if z.get_charset() is None else ' (' + z.get_charset() += ')' > - disp =3D z.get_params(None, header=3D'Content-Disposition') > - if (disp is None): > - disposition =3D '' > - else: > - disposition =3D '' > - for d in disp: > - if d[0] in [ 'attachment', 'inline' ]: > - disposition =3D ' ' + d[0] > - if z.is_multipart(): > - nbytes =3D len(z.as_string()) > - else: > - nbytes =3D len(z.get_payload()) > - > - print('{}{}{}{}{} {:d} bytes'.format( > - prefix, > - z.get_content_type(), > - cset, > - disposition, > - fname, > - nbytes, > - )) > - > -def test(z, prefix=3D''): > - if (z.is_multipart()): > - print_part(z, prefix+'=E2=94=AC=E2=95=B4') > - if prefix.endswith('=E2=94=94'): > - prefix =3D prefix.rpartition('=E2=94=94')[0] + ' ' > - if prefix.endswith('=E2=94=9C'): > - prefix =3D prefix.rpartition('=E2=94=9C')[0] + '=E2=94=82' > - parts =3D z.get_payload() > - i =3D 0 > - while (i < parts.__len__()-1): > - test(parts[i], prefix + '=E2=94=9C') > - i +=3D 1 > - test(parts[i], prefix + '=E2=94=94') > - # FIXME: show epilogue? > - else: > - print_part(z, prefix+'=E2=94=80=E2=95=B4') > - > -test(email.message_from_file(sys.stdin), '=E2=94=94') > --=20 > 2.23.0 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch