Browse Source

Add "bis 2000" notation

Handle cases correctly, where "bis 2000" is used as param 1. Replace
with "{{0|0000}}–" construct
Jonathan Golder 9 months ago
parent
commit
7ae262687e
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      teamstation.py

+ 4
- 0
teamstation.py View File

@@ -120,6 +120,10 @@ class TeamstationBot( CurrentPageBot ):  # sets 'current_page' on each treat()
120 120
                 # Get value of param 1
121 121
                 jahre = occ.get(1);
122 122
 
123
+                # Normalize rarely used "bis 2000" notation
124
+                if "bis" in jahre.value:
125
+                    jahre.value.replace("bis", "{{0|0000}}\u2013")
126
+
123 127
                 # Get parts of value
124 128
                 mo = re.search(r"\s*(\{\{0\|0000\}\}|(?:1|2)\d{3})\s*(–|‐|-|‑|‒|—|―|˗)?\s*((?:1|2)\d{3})?",str(jahre.value))
125 129