jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/491387 )
Change subject: [IMPR] blockpageschecker.py: Improvisation of documentation
......................................................................
[IMPR] blockpageschecker.py: Improvisation of documentation
* Removed xml parameter from documentation because it is already
included by pagegenerators
* Arranged the order of non-default parameters
* Updated copyright year for Pywikibot team
Change-Id: Ic383c8f9f72823620ab360bbe1ead4ac6050bc42
---
M scripts/blockpageschecker.py
1 file changed, 16 insertions(+), 20 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/blockpageschecker.py b/scripts/blockpageschecker.py
index 72bf4cd..8145603 100755
--- a/scripts/blockpageschecker.py
+++ b/scripts/blockpageschecker.py
@@ -14,29 +14,25 @@
¶ms;
--xml Retrieve information from a local XML dump (pages-articles
- or pages-meta-current, see https://dumps.wikimedia.org).
- Argument can also be given as "-xml:filename".
-
--protectedpages: Check all the blocked pages; useful when you have not
- categories or when you have problems with them. (add the
- namespace after ":" where you want to check - default checks
- all protected pages.)
-
--moveprotected: Same as -protectedpages, for moveprotected pages
-
Furthermore, the following command line parameters are supported:
--always Doesn't ask every time whether the bot should make the change.
- Do it always.
+-protectedpages Check all the blocked pages; useful when you have not
+ categories or when you have problems with them. (add the
+ namespace after ":" where you want to check - default checks
+ all protected pages.)
--show When the bot can't delete the template from the page (wrong
- regex or something like that) it will ask you if it should show
- the page on your browser.
- (attention: pages included may give false positives!)
+-moveprotected Same as -protectedpages, for moveprotected pages
--move The bot will check if the page is blocked also for the move
- option, not only for edit
+-always Doesn't ask every time whether the bot should make the change.
+ Do it always.
+
+-show When the bot can't delete the template from the page (wrong
+ regex or something like that) it will ask you if it should
+ show the page on your browser.
+ (attention: pages included may give false positives!)
+
+-move The bot will check if the page is blocked also for the move
+ option, not only for edit
--- Example of how to use the script ---
@@ -51,7 +47,7 @@
# (C) Monobi a.k.a. Wikihermit, 2007
# (C) Filnik, 2007-2011
# (C) Nicolas Dumazet (NicDumZ), 2008-2009
-# (C) Pywikibot team, 2007-2018
+# (C) Pywikibot team, 2007-2019
#
# Distributed under the terms of the MIT license.
#
--
To view, visit https://gerrit.wikimedia.org/r/491387
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic383c8f9f72823620ab360bbe1ead4ac6050bc42
Gerrit-Change-Number: 491387
Gerrit-PatchSet: 4
Gerrit-Owner: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/491384 )
Change subject: Fix documentation of transferbot.py script
......................................................................
Fix documentation of transferbot.py script
Change-Id: Ia333fc64024b1afbca13e1f5858b5ccace210a3c
---
M scripts/transferbot.py
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/transferbot.py b/scripts/transferbot.py
index 86e6e8a..09262dc 100755
--- a/scripts/transferbot.py
+++ b/scripts/transferbot.py
@@ -29,7 +29,8 @@
python pwb.py transferbot -family:wikipedia -lang:en -cat:"Query service" \
-tofamily:wiktionary -tolang:ar -prefix:"Wiktionary:Import enwp/"
-Copy the template "Query service" from the Toolserver wiki to wikitech:
+Copy the template "Query service" from the English Wikipedia to the
+Arabic Wiktionary:
python pwb.py transferbot -family:wikipedia -lang:en \
-tofamily:wiktionary -tolang:ar -page:"Template:Query service"
--
To view, visit https://gerrit.wikimedia.org/r/491384
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia333fc64024b1afbca13e1f5858b5ccace210a3c
Gerrit-Change-Number: 491384
Gerrit-PatchSet: 1
Gerrit-Owner: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/491052 )
Change subject: [tests] Skip page_tests.TestPageUserAction if site is readonly
......................................................................
[tests] Skip page_tests.TestPageUserAction if site is readonly
- purge and watch method cannot be done for an site with readonly state.
Skip the tests in that case.
Bug: T216358
Change-Id: I916020c9cf8bdd3a840cb23730aa5b337029dac4
---
M tests/page_tests.py
1 file changed, 12 insertions(+), 0 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/page_tests.py b/tests/page_tests.py
index 0dbd553..ab7fd24 100644
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -972,6 +972,18 @@
user = True
+ @classmethod
+ def setUpClass(cls):
+ """Set up the test class.
+
+ Check whether the site is write protected and skip the tests then.
+ """
+ super(TestPageUserAction, cls).setUpClass()
+ site = cls.get_site()
+ if site.siteinfo['readonly']:
+ raise unittest.SkipTest('Site {} has readonly state: {}'.format(
+ site, site.siteinfo.get('readonlyreason', '')))
+
def test_purge(self):
"""Test purging the mainpage."""
mainpage = self.get_mainpage()
--
To view, visit https://gerrit.wikimedia.org/r/491052
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I916020c9cf8bdd3a840cb23730aa5b337029dac4
Gerrit-Change-Number: 491052
Gerrit-PatchSet: 4
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/227189 )
Change subject: Enable numbered lists with listify option
......................................................................
Enable numbered lists with listify option
introduce a -prefix option which is added in front of each line.
This allows to create numbered lists with -prefix:# but the default
behaviour is still showing bullet lists (similar to -prefix:*).
Change-Id: I41de718de4e6380fcdc653fc6d275365f94f3af1
---
M scripts/category.py
1 file changed, 19 insertions(+), 8 deletions(-)
Approvals:
Xqt: Looks good to me, but someone else must approve
Dvorapa: Looks good to me, but someone else must approve
D3r1ck01: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/category.py b/scripts/category.py
index 491c3dd..7c0d48a 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -35,6 +35,8 @@
* -showimages - This displays images rather than linking them in the list.
* -talkpages - This outputs the links to talk pages of the pages to be
listified in addition to the pages themselves.
+ * -prefix:# - You may specify a list prefix like "#" for a numbered list or
+ any other prefix. Default is a bullet list with prefix "*".
Options for "remove" action:
@@ -907,7 +909,7 @@
def __init__(self, catTitle, listTitle, editSummary, append=False,
overwrite=False, showImages=False, subCats=False,
- talkPages=False, recurse=False):
+ talkPages=False, recurse=False, prefix='*'):
"""Initializer."""
self.editSummary = editSummary
self.append = append
@@ -919,6 +921,7 @@
self.subCats = subCats
self.talkPages = talkPages
self.recurse = recurse
+ self.prefix = prefix
def run(self):
"""Start bot."""
@@ -936,16 +939,20 @@
if (not article.is_filepage()
or self.showImages) and not article.is_categorypage():
if self.talkPages and not article.isTalkPage():
- listString += '* [[{0}]] -- [[{1}|talk]]\n'.format(
- article.title(), article.toggleTalkPage().title())
+ listString += '{0} [[{1}]] -- [[{2}|talk]]\n'.format(
+ self.prefix, article.title(),
+ article.toggleTalkPage().title())
else:
- listString += '* [[{0}]]\n'.format(article.title())
+ listString += '{0} [[{1}]]\n'.format(self.prefix,
+ article.title())
else:
if self.talkPages and not article.isTalkPage():
- listString += '* [[:{0}]] -- [[{1}|talk]]\n'.format(
- article.title(), article.toggleTalkPage().title())
+ listString += '{0} [[:{1}]] -- [[{2}|talk]]\n'.format(
+ self.prefix, article.title(),
+ article.toggleTalkPage().title())
else:
- listString += '* [[:{0}]]\n'.format(article.title())
+ listString += '{0} [[:{1}]]\n'.format(self.prefix,
+ article.title())
if self.list.exists():
if self.append:
# append content by default at the bottom
@@ -1351,6 +1358,7 @@
move_together = False
keep_sortkey = None
depth = 5
+ prefix = '*'
# Process global args and prepare generator args parser
local_args = pywikibot.handle_args(args)
@@ -1430,6 +1438,8 @@
depth = int(value)
elif option == 'keepsortkey':
keep_sortkey = True
+ elif option == 'prefix':
+ prefix = value
else:
gen_factory.handleArg(arg)
@@ -1515,7 +1525,8 @@
'Please enter the name of the list to create:')
bot = CategoryListifyRobot(old_cat_title, new_cat_title, summary,
append, overwrite, showimages, subCats=True,
- talkPages=talkpages, recurse=recurse)
+ talkPages=talkpages, recurse=recurse,
+ prefix=prefix)
if bot:
pywikibot.Site().login()
--
To view, visit https://gerrit.wikimedia.org/r/227189
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I41de718de4e6380fcdc653fc6d275365f94f3af1
Gerrit-Change-Number: 227189
Gerrit-PatchSet: 3
Gerrit-Owner: Avicennasis <Avicennasis(a)gmail.com>
Gerrit-Reviewer: Avicennasis <Avicennasis(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <Ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)