From b5a1e12d6653b40f5e029ff0e2b0ddc0dc87fdac Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Mon, 15 Jun 2020 19:13:24 +0000 Subject: [PATCH] remove : only in /:list (#212) --- lib/adapter/cmd.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/adapter/cmd.py b/lib/adapter/cmd.py index 5e70c46..314b8f1 100644 --- a/lib/adapter/cmd.py +++ b/lib/adapter/cmd.py @@ -133,7 +133,13 @@ class AdapterOeis(CommandAdapter): # Replace all non (alphanumeric, '-', ':') chars with Spaces to delimit args to oeis.sh if topic.startswith("oeis/"): topic = topic[5:] - topic = re.sub('[^a-zA-Z0-9-:]+', ' ', topic) + + suffix = "" + if topic.endswith("/:list"): + suffix = " :list" + topic = topic[:-6] + + topic = re.sub('[^a-zA-Z0-9-:]+', ' ', topic) + suffix return cmd + [topic]