Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/818121 )

Change subject: [IMPR] Skip the page if it does not exist
......................................................................

[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(-)

Approvals:
  Xqt: Verified; Looks good to me, approved



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 https://gerrit.wikimedia.org/r/c/pywikibot/core/+/818121
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I941ab52d52faaf6c0373e1fc63be8c5432db4bb8
Gerrit-Change-Number: 818121
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Matěj Suchánek <[email protected]>
Gerrit-Reviewer: Mpaa <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to