From commits-return-1110-archive-asf-public=cust-asf.ponee.io@ponymail.incubator.apache.org Sun May 27 02:28:45 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 7988B180679 for ; Sun, 27 May 2018 02:28:44 +0200 (CEST) Received: (qmail 89337 invoked by uid 500); 27 May 2018 00:28:43 -0000 Mailing-List: contact commits-help@ponymail.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ponymail.incubator.apache.org Delivered-To: mailing list commits@ponymail.incubator.apache.org Received: (qmail 89309 invoked by uid 99); 27 May 2018 00:28:43 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 May 2018 00:28:43 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id C9C3082994; Sun, 27 May 2018 00:28:42 +0000 (UTC) Date: Sun, 27 May 2018 00:28:43 +0000 To: "commits@ponymail.apache.org" Subject: [incubator-ponymail] 01/03: Simplify args processing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: sebb@apache.org In-Reply-To: <152738092258.20173.17790622496992064370@gitbox.apache.org> References: <152738092258.20173.17790622496992064370@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-ponymail X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 94cbe515bba25857a549d681e4674a52698d1ce2 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20180527002842.C9C3082994@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. sebb pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git commit 94cbe515bba25857a549d681e4674a52698d1ce2 Author: Sebb AuthorDate: Sun May 27 01:18:55 2018 +0100 Simplify args processing Don't use nargs=1 Assign values directly --- tools/missing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/missing.py b/tools/missing.py index dfaa274..8c55f5c 100755 --- a/tools/missing.py +++ b/tools/missing.py @@ -26,9 +26,9 @@ from elastic import Elastic parser = argparse.ArgumentParser(description='Command line options.') # Cannot have both source and mid as input source_group = parser.add_mutually_exclusive_group(required=True) -source_group.add_argument('--source', dest='source', type=str, nargs=1, metavar='list-name', +source_group.add_argument('--source', dest='source', type=str, metavar='list-name', help='Source list to edit') -source_group.add_argument('--mid', dest='mid', type=str, nargs=1, metavar='message-id', +source_group.add_argument('--mid', dest='mid', type=str, metavar='message-id', help='Source Message-ID to edit') action_group = parser.add_mutually_exclusive_group(required=True) @@ -79,7 +79,7 @@ if args.missing: scroll = '30m' then = time.time() elastic = Elastic() - sourceLID = ("%s" if args.notag else "<%s>") % args.source[0].replace("@", ".").strip("<>") + sourceLID = ("%s" if args.notag else "<%s>") % args.source.replace("@", ".").strip("<>") page = elastic.scan(# defaults to mbox scroll = scroll, body = { -- To stop receiving notification emails like this one, please contact sebb@apache.org.