Xqt has submitted this change and it was merged.
Change subject: pep8-ified scripts/touch.py
......................................................................
pep8-ified scripts/touch.py
Change-Id: Ib1f35b181d3f221f9e3c43b1c244784efa9f1249
---
M scripts/touch.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/touch.py b/scripts/touch.py
index f90ee15..84c2076 100755
--- a/scripts/touch.py
+++ b/scripts/touch.py
@@ -20,7 +20,7 @@
#
# (C) Pywikipedia team
#
-__version__='$Id$'
+__version__ = '$Id$'
#
# Distributed under the terms of the MIT license.
#
@@ -43,7 +43,7 @@
# get the page, and save it using the unmodified text.
# whether or not getting a redirect throws an exception
# depends on the variable self.touch_redirects.
- text = page.get(get_redirect = self.touch_redirects)
+ text = page.get(get_redirect=self.touch_redirects)
page.save("Pywikibot touch script")
except pywikibot.NoPage:
pywikibot.error(u"Page %s does not exist."
--
To view, visit https://gerrit.wikimedia.org/r/80861
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib1f35b181d3f221f9e3c43b1c244784efa9f1249
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: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
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