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

Change subject: Revert "Add custom formatting option to listpages"
......................................................................


Revert "Add custom formatting option to listpages"

(page.title is a method, not an attribute with basestring representation like 
page.site for example)

This reverts commit 53e64b500a80c0a8acca7a594286b7a0a00d5494.

Change-Id: I2405e7b3de4f8ffbb7c12070409f35c1105befca
---
M scripts/listpages.py
1 file changed, 4 insertions(+), 11 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/listpages.py b/scripts/listpages.py
index 8a4476c..ec22d0e 100644
--- a/scripts/listpages.py
+++ b/scripts/listpages.py
@@ -4,12 +4,6 @@
 
 These parameters are supported to specify which pages titles to print:
 
--format  Defines the output format.
-         Default: "{num:4d} {page.title}" (  10 PageTitle)
-
-         Other suggestions:
-         "# {page}" (# [[PageTitle]])
-
 &params;
 """
 #
@@ -28,16 +22,15 @@
 
 def main(*args):
     gen = None
-    fmt = "{num:4d} {page.title}"
     genFactory = GeneratorFactory()
     for arg in pywikibot.handleArgs(*args):
-        if arg.startswith("-format:"):
-            fmt = arg[len("-format:"):]
         genFactory.handleArg(arg)
     gen = genFactory.getCombinedGenerator()
     if gen:
-        for i, page in enumerate(gen):
-            pywikibot.stdout(fmt.format(num=i, page=page))
+        i = 0
+        for page in gen:
+            i += 1
+            pywikibot.stdout("%4d: %s" % (i, page.title()))
     else:
         pywikibot.showHelp()
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2405e7b3de4f8ffbb7c12070409f35c1105befca
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to