Skip to content

Commit

Permalink
handle taxonbot deletion notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
STREBER24 committed May 22, 2024
1 parent 8909dac commit eaa0696
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions deletionInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ def sendDeletionNotifications(site):
logging.info(f'do not notify {author} because already notified on userdisk')
logs[pagetitle][author]['notified'] = False
continue
if not pywikibot.Page(site, pagetitle).exists():
logging.info(f'do not notify {author} because article has been deleted')
logs[pagetitle][author]['notified'] = False
continue
renderedInfo = infoTemplate(author, pagetitle, deletionDiskTitle)
userdisk.text += renderedInfo
delay = time.time() - logs[pagetitle][author]['notified']
Expand Down Expand Up @@ -150,6 +154,7 @@ def checkForExistingInfoOnDisk(disk: pywikibot.Page, pagetitles: set[str]):
for sec in parsed.sections:
if sec.title is None: continue
if (pagetitle not in sec.title) and (wtp.parse(pagetitle).plain_text() not in sec.title): continue
if sec.title.startswith(' Hinweis zur Löschung der Seite') and ('Beste Grüße vom --[[Benutzer:TabellenBot|TabellenBot]] • [[Benutzer Diskussion:Kuebi|Diskussion]]' in sec.contents): continue
if 'lösch' in sec.contents.lower(): return True
return False
except pywikibot.exceptions.InvalidTitleError:
Expand Down

0 comments on commit eaa0696

Please sign in to comment.