diff options
| author | 2026-06-01 12:41:23 +0000 | |
|---|---|---|
| committer | 2026-06-01 12:41:23 +0000 | |
| commit | 06a98b0c19128c281abbc66b82a9f0a6ad1ab901 (patch) | |
| tree | ac5652eefafeecdb82f5c1e72c89d5943698acae | |
| parent | wikibot-m(atf): Use our own User-Agent string (diff) | |
| signature | ||
wikibot-m(ab): Remove from import
They are considered harmful.
| -rw-r--r-- | wikibot-manual/archivebot.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wikibot-manual/archivebot.py b/wikibot-manual/archivebot.py index bed2bef..187fb3c 100644 --- a/wikibot-manual/archivebot.py +++ b/wikibot-manual/archivebot.py @@ -28,7 +28,7 @@ import urllib.request import pywikibot import pywikibot.pagegenerators as pagegenerators -from archiveteamfun import * +import archiveteamfun #{{ stubbed out changes call, only valid if the page is only edited by the bot. @@ -230,7 +230,7 @@ def main(): for entry in sectionentries[section]: viewerplain = '' viewerdetailsplain = '' - viewer = [getArchiveDetails(url=entry.url)] + viewer = [archiveteamfun.getArchiveDetails(url=entry.url)] if viewer[0][0]: viewerplain = "{{saved}}" viewerdetailsplain = viewer[0][1] @@ -267,7 +267,7 @@ Do not edit this table, it is automatically updated by bot. There is a [[{{FULLP |- ! Tool !! Domain !! Job !! Date !! Size !! Objects %s |} -""" % (sectionsaved, sectionnotsaved, convertsize(b=sectionjobsize), notesheader, rowsplain) +""" % (sectionsaved, sectionnotsaved, archiveteamfun.convertsize(b=sectionjobsize), notesheader, rowsplain) newtext.append(output) newtext.append('<!-- /bot -->') @@ -279,13 +279,13 @@ Do not edit this table, it is automatically updated by bot. There is a [[{{FULLP # Replace total statistics if necessary if '<!-- bot-total-stats -->' in newtext: - newtext = re.sub(r'<!-- bot-total-stats -->.*?<!-- /bot-total-stats -->', "<!-- bot-total-stats -->'''Statistics''': {{saved}} (%s)){{·}} {{notsaved}} (%s){{·}} Total size (%s)<!-- /bot-total-stats -->" % (totalsaved, totalnotsaved, convertsize(b = totaljobsize)), newtext) + newtext = re.sub(r'<!-- bot-total-stats -->.*?<!-- /bot-total-stats -->', "<!-- bot-total-stats -->'''Statistics''': {{saved}} (%s)){{·}} {{notsaved}} (%s){{·}} Total size (%s)<!-- /bot-total-stats -->" % (totalsaved, totalnotsaved, archiveteamfun.convertsize(b = totaljobsize)), newtext) if wtext != newtext: pywikibot.showDiff(wtext, newtext) page.text = newtext try: - page.save("BOT - Updating page: {{saved}} (%s), {{notsaved}} (%s), Total size (%s)" % (totalsaved, totalnotsaved, convertsize(b=totaljobsize))) + page.save("BOT - Updating page: {{saved}} (%s), {{notsaved}} (%s), Total size (%s)" % (totalsaved, totalnotsaved, archiveteamfun.convertsize(b=totaljobsize))) except: print("Error while saving...") else: |
