jenkins-bot has submitted this change and it was merged.
Change subject: Fix bug 1659: set correct language as source
......................................................................
Fix bug 1659: set correct language as source
Because the variable 'lang' was used for two different meanings,
the saved language was whatever was read last from the json
configuration.
Change-Id: I2abd7311f6d534f71ffdbec44c80138966d70e1c
---
M scripts/harvest_template.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Ladsgroup: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index c78b97a..05a9c52 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -55,8 +55,8 @@
page = pywikibot.Page(self.repo, 'Wikidata:List of wikis/python')
source_values = json.loads(page.get())
source_values = source_values['wikipedia']
- for lang in source_values:
- source_values[lang] = pywikibot.ItemPage(self.repo, source_values[lang])
+ for source_lang in source_values:
+ source_values[source_lang] = pywikibot.ItemPage(self.repo, source_values[source_lang])
if lang in source_values:
self.source = pywikibot.Claim(self.repo, 'p143')
--
To view, visit https://gerrit.wikimedia.org/r/80976
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2abd7311f6d534f71ffdbec44c80138966d70e1c
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Matmarex <matma.rex(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: Start with a fresh list in html2unicode every time
......................................................................
Start with a fresh list in html2unicode every time
def x(..., something=[]):
something.extend([1,2,3])
means something becomes [1,2,3] on the first call, but
[1,2,3,1,2,3] on the *second* call. This meant html2unicode
got a longer list of replacements every time it is called.
This commit changes it to the standard
def x(..., something=None):
if something is None:
something = []
which means it's always an empty list, instead of what's left from
the last call.
Change-Id: Ifb5221135498633e6e38967fcf4b5a02b14fb4d5
Compat-Change-Id: Ie490b575a8a0cc4b5d45bbb97c0606e0fd64d4f9
---
M pywikibot/page.py
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
Ladsgroup: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 81daf92..db22a9a 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -3265,8 +3265,10 @@
# Utility functions for parsing page titles
-def html2unicode(text, ignore = []):
+def html2unicode(text, ignore = None):
"""Return text, replacing HTML entities by equivalent unicode characters."""
+ if ignore is None:
+ ignore = []
# This regular expression will match any decimal and hexadecimal entity and
# also entities that might be named entities.
entityR = re.compile(
--
To view, visit https://gerrit.wikimedia.org/r/79813
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifb5221135498633e6e38967fcf4b5a02b14fb4d5
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: bot.critical: It's a critical, not a debug record
......................................................................
bot.critical: It's a critical, not a debug record
Change-Id: Iefff68e78e3b3341157110c0080520451ab1d7bf
---
M pywikibot/bot.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index fa7ee43..220f77a 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -404,7 +404,7 @@
def critical(text, decoder=None, newline=True, **kwargs):
- """Output a debug record to the log file."""
+ """Output a critical record to the log file."""
logoutput(text, decoder, newline, CRITICAL, **kwargs)
--
To view, visit https://gerrit.wikimedia.org/r/80966
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iefff68e78e3b3341157110c0080520451ab1d7bf
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mineo <themineo(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: bug fix for 1655
......................................................................
bug fix for 1655
* solve sub-optimal messages to user (indicate needed admin rights)
* add missing ubuntu package names
* message improved in case if NO was chosen
Change-Id: Ibe5e42e6c7cf5450ac527dd0fec681d93ced649e
---
M externals/__init__.py
1 file changed, 16 insertions(+), 8 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/externals/__init__.py b/externals/__init__.py
index 3bb6677..c94047c 100644
--- a/externals/__init__.py
+++ b/externals/__init__.py
@@ -55,12 +55,12 @@
# spelling http://svn.wikimedia.org/svnroot/pywikipedia/trunk/spelling/
# $ git submodule add https://gerrit.wikimedia.org/r/p/pywikibot/spelling.git externals/spelling
'BeautifulSoup.py': ({'linux-fedora': ['python-BeautifulSoup'],
- 'linux-ubuntu': ['']},
+ 'linux-ubuntu': ['python-beautifulsoup']},
{ 'url': 'https://pypi.python.org/packages/source/B/BeautifulSoup/BeautifulSoup-3.2.0…',
'path': 'BeautifulSoup-3.2.0/BeautifulSoup.py'},
{}), # OK
'irclib': ({'linux-fedora': ['python-irclib'],
- 'linux-ubuntu': ['']},
+ 'linux-ubuntu': ['python-irclib']},
{}, # http://python-irclib.sourceforge.net/
{}), # OK
'mwparserfromhell': ({},
@@ -197,13 +197,15 @@
return ("%s-%s" % (platform.system(), platform.dist()[0])).lower()
-def show_question(which_files):
+def show_question(which_files, admin=True):
lowlevel_warning("Required package missing: %s" % which_files)
lowlevel_warning("A required package is missing, but externals can"
- " automatically install it."
- " If you say Yes, externals will need administrator"
- " privileges, and you might be asked for the administrator"
- " password. For more info, please confer:\n"
+ " automatically install it.")
+ if admin:
+ lowlevel_warning("If you say Yes, externals will need administrator"
+ " privileges, and you might be asked for the"
+ " administrator password.")
+ lowlevel_warning("For more info, please confer:\n"
" http://www.mediawiki.org/wiki/Manual:Pywikipediabot/"
"Installation#Dependencies")
lowlevel_warning("Give externals permission to try to install package?"
@@ -308,7 +310,7 @@
def download_install(package, module, path):
- if package and show_question(module):
+ if package and show_question(module, admin=False):
lowlevel_warning(u'Download package "%s" from %s'
% (module, package['url']))
import mimetypes
@@ -393,13 +395,19 @@
lowlevel_warning(u'Trying to install by use of "%s" package management system:' % dist)
if (func in globals()) and globals()[func](modules_needed[m][0]):
return
+ else:
+ lowlevel_warning(u'No suitable package could be installed or found!')
lowlevel_warning(u'Trying to install by download from source URL:')
if download_install(modules_needed[m][1], m, path):
return
+ else:
+ lowlevel_warning(u'No suitable package could be installed or found!')
lowlevel_warning(u'Trying to install by use of mercurial:')
if (len(modules_needed[m]) > 2) and\
mercurial_repo_install(modules_needed[m][2], m, path):
return
+ else:
+ lowlevel_warning(u'No suitable package could be installed or found!')
lowlevel_warning(u'Package "%s" could not be found nor installed!' % m)
lowlevel_warning(u'Several scripts might fail, if some modules are not'
--
To view, visit https://gerrit.wikimedia.org/r/79977
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe5e42e6c7cf5450ac527dd0fec681d93ced649e
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: DrTrigon <dr.trigon(a)surfeu.ch>
Gerrit-Reviewer: DrTrigon <dr.trigon(a)surfeu.ch>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Nikerabbit <niklas.laxstrom(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: pwb.bot.debug: Document the `layer` argument
......................................................................
pwb.bot.debug: Document the `layer` argument
Change-Id: Id1efa0fa1091ccbe65507f488fba6dde3607401e
---
M pywikibot/bot.py
1 file changed, 4 insertions(+), 1 deletion(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index fa7ee43..eb66ad1 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -409,7 +409,10 @@
def debug(text, layer, decoder=None, newline=True, **kwargs):
- """Output a debug record to the log file."""
+ """Output a debug record to the log file.
+
+ @param layer: The name of the logger that text will be sent to.
+ """
logoutput(text, decoder, newline, DEBUG, layer, **kwargs)
--
To view, visit https://gerrit.wikimedia.org/r/80796
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id1efa0fa1091ccbe65507f488fba6dde3607401e
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mineo <themineo(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: Make ItemPage.editEntity() functional for creating a new item
......................................................................
Make ItemPage.editEntity() functional for creating a new item
Patch: https://sourceforge.net/p/pywikipediabot/patches/611/
Change-Id: Ia5c578e4a0cfcc3f80092c4496b48474cf95ee06
---
M pywikibot/site.py
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
Ladsgroup: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index bca3feb..ef00047 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -3419,6 +3419,8 @@
@must_be(group='user')
def editEntity(self, identification, data, bot=True, **kwargs):
+ if "id" in identification and identification["id"] == "-1":
+ del identification["id"]
params = dict(**identification)
if not params: # If no identification was provided
params['new'] = 'item' # TODO create properties+queries
--
To view, visit https://gerrit.wikimedia.org/r/80330
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia5c578e4a0cfcc3f80092c4496b48474cf95ee06
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot