Xqt submitted this change.

View Change

Approvals: Xqt: Verified; Looks good to me, approved
[IMPR] Skip the page if it does not exist

If a page does not exist e.g. given with -page option
show the right message and skip instead of printing
"ERROR: Missing or malformed template in page..."

Change-Id: I941ab52d52faaf6c0373e1fc63be8c5432db4bb8
---
M scripts/archivebot.py
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index 19ab8cf..8723eb9 100755
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -829,6 +829,9 @@
namespaces=ns,
content=True)
for pg in gen:
+ if not pg.exists():
+ pywikibot.info('{} does not exist, skipping...'.format(pg))
+ continue
pywikibot.info('\n\n>>> <<lightpurple>>{}<<default>> <<<'
.format(pg.title()))
# Catching exceptions, so that errors in one page do not bail out

To view, visit change 818121. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I941ab52d52faaf6c0373e1fc63be8c5432db4bb8
Gerrit-Change-Number: 818121
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97@gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged