From 4137d7246830610ef68466987b74e7dfcbbc090a Mon Sep 17 00:00:00 2001 From: Jonathan Golder Date: Tue, 22 Aug 2017 21:56:43 +0200 Subject: [PATCH] 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) --- bots/markpages.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bots/markpages.py b/bots/markpages.py index 4e12620..ffef940 100644 --- a/bots/markpages.py +++ b/bots/markpages.py @@ -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(