Implement Save changes back to wiki

This commit is contained in:
2018-09-08 12:30:05 +02:00
parent 7208c70e26
commit 33fc676a7f
+7
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_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 ): def __init__( self, genFactory, **kwargs ):
""" """
@@ -93,6 +94,12 @@ class TeamstationBot( CurrentPageBot ): # sets 'current_page' on each treat()
# Normalize param 1 (jahre) # Normalize param 1 (jahre)
self.normalize_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): def normalize_jahre(self):
""" """
Replace wrong dash symbols and do some space normalisations in param 1 Replace wrong dash symbols and do some space normalisations in param 1