jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/197901 )
Change subject: API help module support for 1.25+
......................................................................
API help module support for 1.25+
Add 'wrap' argument to force json output of help module.
This does not address the difference json results from
pre-1.25.
Bug: T93188
Change-Id: I14672494ec9e98fadec67785ce45a134f6af7321
---
M pywikibot/data/api.py
1 file changed, 5 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 741a75b..ebe9241 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -961,6 +961,11 @@
'rawcontinue' not in self._params and
MediaWikiVersion(self.site.version()) >= MediaWikiVersion('1.25wmf5')):
self._params['rawcontinue'] = ['']
+ elif (self.action == 'help'
+ and MediaWikiVersion(self.site.version())
+ > MediaWikiVersion('1.24')):
+ self._params['wrap'] = ['']
+
if "maxlag" not in self._params and config.maxlag:
self._params["maxlag"] = [str(config.maxlag)]
if "format" not in self._params:
--
To view, visit https://gerrit.wikimedia.org/r/197901
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I14672494ec9e98fadec67785ce45a134f6af7321
Gerrit-Change-Number: 197901
Gerrit-PatchSet: 3
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(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 <>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/426751 )
Change subject: [FEAT] Show a warning if user does not exists on a given site
......................................................................
[FEAT] Show a warning if user does not exists on a given site
This is a more general solution of T191950
Bug: T191950
Change-Id: Ib2c74c580f22c393b4fee99d53260f2f71d07c06
---
M pywikibot/pagegenerators.py
1 file changed, 8 insertions(+), 3 deletions(-)
Approvals:
Framawiki: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index 9ecdf2e..684c0f9 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -1521,10 +1521,15 @@
"""
if site is None:
site = pywikibot.Site()
+
+ user = pywikibot.User(site, username)
+ if not (user.isAnonymous() or user.isRegistered()):
+ pywikibot.warning('User "{}" does not exist on site "{}".'
+ .format(user.username, site))
+
return _filter_unique(
- pywikibot.Page(pywikibot.Link(contrib["title"], source=site))
- for contrib in site.usercontribs(user=username, namespaces=namespaces,
- total=total)
+ contrib[0]
+ for contrib in user.contributions(namespaces=namespaces, total=total)
)
--
To view, visit https://gerrit.wikimedia.org/r/426751
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib2c74c580f22c393b4fee99d53260f2f71d07c06
Gerrit-Change-Number: 426751
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Framawiki <framawiki(a)tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/426815 )
Change subject: [FEAT] Show the python version when starting pwb shell
......................................................................
[FEAT] Show the python version when starting pwb shell
- Show the python version as command line title on windows when starting
the shell script. This is usefull for example if you have different
python versions installed and start one of them with the python
launcher. This shows the started version.
Change-Id: Iabeca656ab2739e117c3704047ec5c827f26803c
---
M scripts/shell.py
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
Framawiki: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/shell.py b/scripts/shell.py
index 07b16af..f99183b 100755
--- a/scripts/shell.py
+++ b/scripts/shell.py
@@ -30,6 +30,10 @@
if __name__ == "__main__":
import sys
+ if sys.platform == 'win32':
+ import os
+ os.system('title Python {} Shell'.format(*sys.version.split(' ', 1)))
+ del os
args = []
if set(sys.argv) - {'shell', 'shell.py'}:
args = sys.argv
--
To view, visit https://gerrit.wikimedia.org/r/426815
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iabeca656ab2739e117c3704047ec5c827f26803c
Gerrit-Change-Number: 426815
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Framawiki <framawiki(a)tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/426638 )
Change subject: [IMPR][doc] Make usage of title in pagefromfile.py more clear
......................................................................
[IMPR][doc] Make usage of title in pagefromfile.py more clear
+ make clear the whole intro to the file
+ remove safe option as it sets the default values only
Bug: T155356
Change-Id: Ie2265a40a25d0157fb5818d11b69820905805b37
---
M scripts/pagefromfile.py
1 file changed, 47 insertions(+), 48 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/pagefromfile.py b/scripts/pagefromfile.py
index 36fb613..a13d9de 100755
--- a/scripts/pagefromfile.py
+++ b/scripts/pagefromfile.py
@@ -1,62 +1,64 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
r"""
-Bot to upload pages from a file.
+Bot to upload pages from a text file.
-This bot takes its input from a file that contains a number of
-pages to be put on the wiki. The pages should all have the same
-begin and end text (which may not overlap).
+This bot takes its input from the UTF-8 text file that contains
+a number of pages to be put on the wiki. The pages should all have
+the same beginning and ending text (which may not overlap).
+The beginning and ending text is not uploaded with the page content
+by default.
-By default the text should have the intended title of the page
-as the first text in bold (that is, between ''' and '''),
-you can modify this behavior with command line options.
-
-The default is not to include the begin and
-end text in the page, if you want to include that text, use
-the -include option.
+As a pagename is by default taken the first text block
+from the page content marked in bold (wrapped between ''' and ''').
+If you expect the page title not to be present in the text
+or marked by different markers, use -titlestart, -titleend,
+and -notitle parameters.
Specific arguments:
--begin:xxx Specify the text that marks the beginning of a page
--end:xxx Specify the text that marks the end of a page
--file:xxx Give the filename we are getting our material from
- (default: dict.txt)
--include The beginning and end markers should be included
- in the page.
--titlestart:xxx Use xxx in place of ''' for identifying the
- beginning of page title
--titleend:xxx Use xxx in place of ''' for identifying the
- end of page title
--notitle do not include the title, including titlestart, and
- titleend, in the page
--nocontent If page has this statment it doesn't append
- (example: -nocontent:"{{infobox")
--noredirect if you don't want to upload on redirect page
- it is True by default and bot adds pages to redirected pages
--summary:xxx Use xxx as the edit summary for the upload - if
- a page exists, standard messages are appended
- after xxx for appending, prepending, or replacement
--autosummary Use MediaWikis autosummary when creating a new page,
- overrides -summary in this case
--minor set minor edit flag on page edits
--showdiff show difference between page and page to upload; it forces
- -always=False; default to False.
+-file:xxx The filename we are getting our material from,
+ the default value is "dict.txt"
+-begin:xxx The text that marks the beginning of a page,
+ the default value is "{{-start-}}"
+-end:xxx The text that marks the end of the page,
+ the default value is "{{-stop-}}"
+-include Include the beginning and end markers to the page
+-titlestart:xxx The text used in place of ''' for identifying
+ the beginning of a page title
+-titleend:xxx The text used in place of ''' for identifying
+ the end of the page title
+-notitle Do not include the page title, including titlestart
+ and titleend, to the page. Can be used to specify unique
+ page title above the page content
+-nocontent:xxx If the existing page contains specified statement,
+ the page is skipped from editing
+-noredirect Do not upload on redirect pages
+-summary:xxx The text used as an edit summary for the upload.
+ If the page exists, standard messages for prepending,
+ appending, or replacement are appended after it
+-autosummary Use MediaWiki's autosummary when creating a new page,
+ overrides -summary
+-minor Set the minor edit flag on page edits
+-showdiff Show difference between current page and page to upload,
+ also forces the bot to ask for confirmation
+ on every edit
-If the page to be uploaded already exists:
+If the page to be uploaded already exists, it is skipped by default.
+But you can override this behavior if you want to:
--safe do nothing (default)
--appendtop add the text to the top of it
--appendbottom add the text to the bottom of it
--force overwrite the existing page
+-appendtop Add the text to the top of the existing page
+-appendbottom Add the text to the bottom of the existing page
+-force Overwrite the existing page
-It's possible to define a separator after the 'append' modes which is added
-between the exisiting and new text. For example -appendtop:foo would add 'foo'
-between the parts. The \n (two separate characters) is replaced by the newline
-character.
+It is possible to define a separator after the 'append' modes which
+is added between the existing and the new text. For example
+a parameter -appendtop:foo would add 'foo' between them. A new line
+can be added between them by specifying '\n' as a value.
"""
#
# (C) Andre Engels, 2004
-# (C) Pywikibot team, 2005-2017
+# (C) Pywikibot team, 2005-2018
#
# Distributed under the terms of the MIT license.
#
@@ -307,9 +309,6 @@
options['append'] = ('top', value)
elif option in ('force', 'minor', 'autosummary', 'showdiff'):
options[option] = True
- elif option == 'safe':
- options['force'] = False
- options['append'] = None
elif option == 'noredirect':
options['redirect'] = False
elif option in ('nocontent', 'summary'):
--
To view, visit https://gerrit.wikimedia.org/r/426638
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie2265a40a25d0157fb5818d11b69820905805b37
Gerrit-Change-Number: 426638
Gerrit-PatchSet: 6
Gerrit-Owner: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Wesalius <jonas.dyba(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>