jenkins-bot has submitted this change and it was merged.

Change subject: Improvements to listpages.py
......................................................................


Improvements to listpages.py

1. Structure of listpages.py now like in other scripts.
2. Removed uneeded except part which caused bad output.
3. Fixed typing error. parameterd -> parameters

Change-Id: Iacc0e929482b4baac12a078bdc9faf813f773444
---
M scripts/listpages.py
1 file changed, 17 insertions(+), 19 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/listpages.py b/scripts/listpages.py
index 2cb668b..96bc235 100644
--- a/scripts/listpages.py
+++ b/scripts/listpages.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8  -*-
 """
-Print a list of pages, as defined by page generator parameterd
+Print a list of pages, as defined by page generator parameters
 
 These parameters are supported to specify which pages titles to print:
 
@@ -20,23 +20,21 @@
 
 
 def main(*args):
-    try:
-        gen = None
-        genFactory = GeneratorFactory()
-        for arg in pywikibot.handleArgs(*args):
-            genFactory.handleArg(arg)
-        gen = genFactory.getCombinedGenerator()
-        if gen:
-            i = 0
-            for page in gen:
-                i += 1
-                pywikibot.stdout("%4d: %s" % (i, page.title()))
-        else:
-            pywikibot.showHelp()
-    except Exception:
-        pywikibot.error("Fatal error", exc_info=True)
-    finally:
-        pywikibot.stopme()
+    gen = None
+    genFactory = GeneratorFactory()
+    for arg in pywikibot.handleArgs(*args):
+        genFactory.handleArg(arg)
+    gen = genFactory.getCombinedGenerator()
+    if gen:
+        i = 0
+        for page in gen:
+            i += 1
+            pywikibot.stdout("%4d: %s" % (i, page.title()))
+    else:
+        pywikibot.showHelp()
 
 if __name__ == "__main__":
-    main()
+    try:
+        main()
+    finally:
+        pywikibot.stopme()

-- 
To view, visit https://gerrit.wikimedia.org/r/94605
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iacc0e929482b4baac12a078bdc9faf813f773444
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Pyfisch <pyfi...@googlemail.com>
Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhall...@arctus.nl>
Gerrit-Reviewer: Pyfisch <pyfi...@googlemail.com>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to