From 7ae262687ee592545b7b6e259ab251e2af5d437a Mon Sep 17 00:00:00 2001 From: Jonathan Golder Date: Sat, 8 Sep 2018 12:30:34 +0200 Subject: [PATCH] Add "bis 2000" notation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Handle cases correctly, where "bis 2000" is used as param 1. Replace with "{{0|0000}}–" construct --- teamstation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/teamstation.py b/teamstation.py index df2a3fd..e1da67e 100644 --- a/teamstation.py +++ b/teamstation.py @@ -120,6 +120,10 @@ class TeamstationBot( CurrentPageBot ): # sets 'current_page' on each treat() # Get value of param 1 jahre = occ.get(1); + # Normalize rarely used "bis 2000" notation + if "bis" in jahre.value: + jahre.value.replace("bis", "{{0|0000}}\u2013") + # Get parts of value mo = re.search(r"\s*(\{\{0\|0000\}\}|(?:1|2)\d{3})\s*(–|‐|-|‑|‒|—|―|˗)?\s*((?:1|2)\d{3})?",str(jahre.value))