Browse Source

Implement Save changes back to wiki

Jonathan Golder 10 months 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()
45 45
     """
46 46
 
47 47
     wrong_dash_search = r"hastemplate:Team-Station insource:/Team-Station *\| *[12][0-9]{3} *(‐|-|‑|‒|—|―|˗)/"
48
+    wrong_dash_summary = "Bot: ([[Benutzer:JogoBot/Teamstation|teamstation]]) Korrigiere falschen [[Halbgeviertstrich#Bis-Strich|Bis-Strich]]"
48 49
 
49 50
     def __init__( self, genFactory, **kwargs ):
50 51
         """
@@ -93,6 +94,12 @@ class TeamstationBot( CurrentPageBot ):  # sets 'current_page' on each treat()
93 94
         # Normalize param 1 (jahre)
94 95
         self.normalize_jahre()
95 96
 
97
+        # Convert wikicode back to string to save
98
+        self.new_text = str( self.current_page.wikicode )
99
+
100
+        # Save
101
+        self.put_current(self.new_text, summary=type(self).wrong_dash_summary)
102
+
96 103
     def normalize_jahre(self):
97 104
         """
98 105
         Replace wrong dash symbols and do some space normalisations in param 1