ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [incubator-ponymail] 01/03: Simplify args processing
Date Sun, 27 May 2018 00:28:43 GMT
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 <sebb@apache.org>
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.

Mime
View raw message