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:
2017-08-22 21:56:43 +02:00
parent cd87d1c2bb
commit 4137d72468

View File

@@ -268,6 +268,10 @@ class MarkPagesBot( CurrentPageBot ): # sets 'current_page' on each treat()
"""
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
# Link to decide if they are the same
for present_notice in self.current_wikicode.ifilter_templates(