From f2a906c9305f7e10b9872b6ac7d3e3fb748b689b Mon Sep 17 00:00:00 2001 From: yzqzss Date: Wed, 4 Dec 2024 11:19:59 +0800 Subject: [PATCH] mark --exnamespaces lack maintenanced --- wikiteam3/dumpgenerator/cli/cli.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wikiteam3/dumpgenerator/cli/cli.py b/wikiteam3/dumpgenerator/cli/cli.py index 37e34647..a2049422 100644 --- a/wikiteam3/dumpgenerator/cli/cli.py +++ b/wikiteam3/dumpgenerator/cli/cli.py @@ -140,7 +140,7 @@ def getArgumentParser(): group_download.add_argument( "--exnamespaces", metavar="1,2,3", - help="comma-separated value of namespaces to exclude", + help="[lack maintenance] comma-separated value of namespaces to exclude", ) group_download.add_argument( "--images", action="store_true", help="Generates an image dump" @@ -501,13 +501,14 @@ def sleep(self, response=None): # Process namespace exclusions if args.exnamespaces: - if re.search(r"[^\d, \-]", args.exnamespaces): + # if re.search(r"[^\d, \-]", args.exnamespaces): + if any([not i.isdigit() for i in args.exnamespaces.split(",")]): print( "Invalid namespace values.\nValid format is integer(s) separated by commas" ) sys.exit(1) else: - ns = re.sub(" ", "", args.exnamespaces) + ns = args.exnamespaces.replace(" ", "") if ns.lower() == "all": print("You cannot exclude all namespaces.") sys.exit(1)