aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2022-06-25 16:40:08 +0200
committerTeddy Wing2022-06-25 16:40:08 +0200
commit6204c785395ec2ec82a757180be1aa5a7e280f01 (patch)
tree0384cd181dfcfe9f9408e66a84bf2245ed8ff85e
parentefac015cebeb9c20c1dea00d21e372cc64f2efe1 (diff)
downloadcws-status-6204c785395ec2ec82a757180be1aa5a7e280f01.tar.bz2
cws-status: Match regex anywhere in the name
I didn't realise that `re.match()` only matches starting at the beginning of the string rather than matching anywhere inside it: https://docs.python.org/3/library/re.html#re.match Switch to `re.search()` to get the desired behaviour.
-rw-r--r--cws-status2
1 files changed, 1 insertions, 1 deletions
diff --git a/cws-status b/cws-status
index b332f77..d6302e7 100644
--- a/cws-status
+++ b/cws-status
@@ -90,5 +90,5 @@ item_statuses = tree.xpath('//table[//th[text()="Item"]]/tbody/tr/td[7]/text()')
# Print the publish status for the queried extensions.
for i, name in enumerate(item_names_versions):
- if re.match(regex, name):
+ if re.search(regex, name):
print(f'{name}\t{item_statuses[i]}')