From 078411223d0a29bc592f30a0c3b03e17b2adeb6f Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 5 Jun 2020 10:04:35 -0400 Subject: [PATCH] Fixed chmod arg parse issue, formating/comments better --- lib/adapter/cmd.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/adapter/cmd.py b/lib/adapter/cmd.py index 1654b74..9d01e22 100644 --- a/lib/adapter/cmd.py +++ b/lib/adapter/cmd.py @@ -130,10 +130,10 @@ class AdapterOeis(CommandAdapter): cmd[0] = _get_abspath(cmd[0]) # cut oeis/ off - # Replace all (non numeric and non '-')'s with Spaces to delimit args to oeis.sh + # Replace all non (numeric, '-') chars with Spaces to delimit args to oeis.sh if topic.startswith("oeis/"): - topic = topic[5:] - topic = re.sub('[^0-9-]', ' ', topic) + topic = topic[5:] + topic = re.sub('[^0-9-]', ' ', topic) return cmd + [topic] @@ -155,10 +155,13 @@ class AdapterChmod(CommandAdapter): cmd = self._command[:] # cut chmod/ off + # remove all non (alphanumeric, '-') chars if topic.startswith("chmod/"): topic = topic[6:] + topic = re.sub('[^a-z^A-Z^0-9-]', '', topic) + return cmd + [topic] def is_found(self, topic): - return True + return True