Look for existing notice by simple in-check
To detect maybe uncommented notices already present, check for them using just a simple python x in y check over whole wikicode Related Task: [FS#138](https://fs.golderweb.de/index.php?do=details&task_id=138)
This commit is contained in:
@@ -268,6 +268,10 @@ class MarkPagesBot( CurrentPageBot ): # sets 'current_page' on each treat()
|
|||||||
"""
|
"""
|
||||||
Checks if disc notice which shall be added is already present.
|
Checks if disc notice which shall be added is already present.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if self.disc_notice in self.current_wikicode:
|
||||||
|
return True
|
||||||
|
|
||||||
# Iterate over Templates with same name (if any) to search equal
|
# Iterate over Templates with same name (if any) to search equal
|
||||||
# Link to decide if they are the same
|
# Link to decide if they are the same
|
||||||
for present_notice in self.current_wikicode.ifilter_templates(
|
for present_notice in self.current_wikicode.ifilter_templates(
|
||||||
|
|||||||
Reference in New Issue
Block a user