Xqt submitted this change.
[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.