Browse Source

Implement Save changes back to wiki

tags/v0.1^2
Jonathan Golder 1 year ago
parent
commit
33fc676a7f
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      teamstation.py

+ 7
- 0
teamstation.py View File

@@ -45,6 +45,7 @@ class TeamstationBot( CurrentPageBot ): # sets 'current_page' on each treat()
"""

wrong_dash_search = r"hastemplate:Team-Station insource:/Team-Station *\| *[12][0-9]{3} *(‐|-|‑|‒|—|―|˗)/"
wrong_dash_summary = "Bot: ([[Benutzer:JogoBot/Teamstation|teamstation]]) Korrigiere falschen [[Halbgeviertstrich#Bis-Strich|Bis-Strich]]"

def __init__( self, genFactory, **kwargs ):
"""
@@ -93,6 +94,12 @@ class TeamstationBot( CurrentPageBot ): # sets 'current_page' on each treat()
# Normalize param 1 (jahre)
self.normalize_jahre()

# Convert wikicode back to string to save
self.new_text = str( self.current_page.wikicode )

# Save
self.put_current(self.new_text, summary=type(self).wrong_dash_summary)

def normalize_jahre(self):
"""
Replace wrong dash symbols and do some space normalisations in param 1

Loading…
Cancel
Save