jenkins-bot has submitted this change and it was merged.
Change subject: Allow Subject.originPage to be updated
......................................................................
Allow Subject.originPage to be updated
3488a4b1bb introduced a bug by changing a attribute to be a property
without a setter, however interwiki.py frequently sets this value.
Change-Id: I656e03a1d7499f7e1ba79185a8c55a5d3061681a
---
M pywikibot/interwiki_graph.py
1 file changed, 13 insertions(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/interwiki_graph.py b/pywikibot/interwiki_graph.py
index 91aa181..2263dbc 100644
--- a/pywikibot/interwiki_graph.py
+++ b/pywikibot/interwiki_graph.py
@@ -91,6 +91,11 @@
"""Page on the origin wiki."""
return self._origin
+ @origin.setter
+ def origin(self, value):
+ """Page on the origin wiki."""
+ self._origin = value
+
@property
def originPage(self):
"""Deprecated property for the origin page.
@@ -100,6 +105,14 @@
# TODO: deprecate this property
return self.origin
+ @originPage.setter
+ def originPage(self, value):
+ """Deprecated property for the origin page.
+
+ DEPRECATED. Use origin.
+ """
+ self.origin = value
+
@property
def foundIn(self):
"""Mapping of pages to others pages interwiki linked to it.
--
To view, visit https://gerrit.wikimedia.org/r/222605
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I656e03a1d7499f7e1ba79185a8c55a5d3061681a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
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: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Release 2.0rc2
......................................................................
Release 2.0rc2
Change-Id: I64154d9f9138e25f21b32a223f6d2b96c32ca0e3
---
M ChangeLog
M setup.py
2 files changed, 43 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ChangeLog b/ChangeLog
index 0af0188..7ba2f56 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,47 @@
+Release 2.0rc2 (9 July 2015)
+============================
+
+Bugfixes (scripts)
+------------------
+8d76870 replace.py: remove line endings when reading from file
+bfe60b0 archive.py: Don't ignore "DoNotArchiveUntil" timestamps
+0df272b redirect.py: Don't break the script for hidden pages.
+9806a7a upload.py: allow all formats allowed by commons
+1dcbfd8, 0592360 replace.py: fix handling of addedCat
+
+Small new features (scripts)
+----------------------------
+a47c0d7 clean_sandbox.py: Use pagegenerators
+288b9ce replace.py: Inform about missing user-fixes.py
+
+Configuration updates
+---------------------
+d721249 Changing the sandbox content template on Fa WP
+
+Family file updates
+-------------------
+21d6a8d Remove broken wikis from battlestarwiki family
+3c2bcc5 Adding euskara and sicilianu languages to Vikidia family
+a3a3d53 WOW Wiki subdomains hr, ro & sr deleted
+474c786 Add new Wikipedia languages gom and lrc
+
+Bugfixes (core)
+---------------
+c7a12b5 fix UnicodeDecodeError on api error
+ea00683 pwb.py now correctly passes arguments to generate_family_file
+3685a24 Fix Win32 config.editor detection
+3333251 open_compressed: Wrap BZ2File in Py 2.7
+f2309e5 Skip RC entries without a title
+ab9fdfb PatrolEntry: Allow cur/prev id to be str
+156bdd0, 0b6fda9 Updates to i18n changes
+49fc65f Do not use ParamInfo during action=login
+796f273 Let pydot encode labels for Python 3 support
+3488a4b Fix and test interwiki_graph
+ba6b671 textlib: replaceExcept: Handle empty matches
+
Release 2.0rc1 (25 May 2015)
-
+============================
Major improvements include:
- Sphinx documentation at https://doc.wikimedia.org/pywikibot/
- Initial ProofreadPage support
diff --git a/setup.py b/setup.py
index 4203025..e597c12 100644
--- a/setup.py
+++ b/setup.py
@@ -133,7 +133,7 @@
from setuptools import setup, find_packages
name = 'pywikibot'
-version = '2.0rc1.post2'
+version = '2.0rc2'
github_url = 'https://github.com/wikimedia/pywikibot-core'
setup(
--
To view, visit https://gerrit.wikimedia.org/r/224021
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I64154d9f9138e25f21b32a223f6d2b96c32ca0e3
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
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: Ricordisamoa <ricordisamoa(a)openmailbox.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] undelete: Get correct token
......................................................................
[FIX] undelete: Get correct token
The original implementation cdc2e9f4 used `undelete` token and added it as an
old token type. So on new implementations using the CSRF token this worked as
it mapped the token to CSRF. But old versions of MediaWiki which don't use the
CSRF token yet it'll fail because that token never existed.
The change in d4e6e60c broke then this also on newer versions as it only mapped
old token names to the CSRF token if they were actually old token name. And
that is not the case for `undelete` so it wasn't mapped to CSRF.
With 730bad3f the tokens for `delete` and `undelete` are the same and so it can
just use the `delete` token which will be mapped to CSRF on recent versions.
Bug: T105635
Change-Id: I9419aac0bc590fd3a3ed484012608f25dcf01cea
---
M pywikibot/site.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 1915cde..5e3a53f 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -4552,7 +4552,7 @@
@type reason: basestring
"""
- token = self.tokens['undelete']
+ token = self.tokens['delete']
self.lock_page(page)
if revisions is None:
--
To view, visit https://gerrit.wikimedia.org/r/224431
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9419aac0bc590fd3a3ed484012608f25dcf01cea
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
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: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] Handle single quotes in usernames on Travis
......................................................................
[FIX] Handle single quotes in usernames on Travis
The username is written multiple times into the user-config surrounded by
single quotes. So if the username itself contains them these needs to be
escaped.
Bug: T105783
Change-Id: I54a7228f77e8cba653b25bd6e10bd4d4fee55e28
---
M .travis.yml
M tests/README.rst
2 files changed, 5 insertions(+), 5 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.travis.yml b/.travis.yml
index 4108055..c134973 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -49,10 +49,10 @@
- python -W error::UserWarning -m generate_user_files -dir:~/.pywikibot/ -family:$FAMILY -lang:$LANGUAGE -v -user:"$PYWIKIBOT2_USERNAME"
- if [[ -n "$USER_PASSWORD" && -n "$PYWIKIBOT2_USERNAME" ]]; then
- echo "usernames['wikipedia']['en'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
- echo "usernames['wikipedia']['test'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
- echo "usernames['wikidata']['test'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
- echo "usernames['commons']['commons'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
+ printf "usernames['wikipedia']['en'] = '%q'\n" "$PYWIKIBOT2_USERNAME" >> ~/.pywikibot/user-config.py ;
+ printf "usernames['wikipedia']['test'] = '%q'\n" "$PYWIKIBOT2_USERNAME" >> ~/.pywikibot/user-config.py ;
+ printf "usernames['wikidata']['test'] = '%q'\n" "$PYWIKIBOT2_USERNAME" >> ~/.pywikibot/user-config.py ;
+ printf "usernames['commons']['commons'] = '%q'\n" "$PYWIKIBOT2_USERNAME" >> ~/.pywikibot/user-config.py ;
printf "('%q', '%q')\n" "$PYWIKIBOT2_USERNAME" "$USER_PASSWORD" > ~/.pywikibot/passwordfile ;
echo "import os" >> ~/.pywikibot/user-config.py ;
echo "password_file = os.path.expanduser('~/.pywikibot/passwordfile')" >> ~/.pywikibot/user-config.py ;
diff --git a/tests/README.rst b/tests/README.rst
index a35c089..4099c0e 100644
--- a/tests/README.rst
+++ b/tests/README.rst
@@ -109,7 +109,7 @@
4. The next build should run tests that require a logged in user
While passwords in travis-ci environment variables are not leaked in normal
-operations, you are responsible for your own passwords. If the password contains
+operations, you are responsible for your own passwords. If the variables contain
single quotes it is necessary to surround them in double quotes (see also
`travis-ci #4350 <https://github.com/travis-ci/travis-ci/issues/4350>`_).
--
To view, visit https://gerrit.wikimedia.org/r/225091
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I54a7228f77e8cba653b25bd6e10bd4d4fee55e28
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
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: Ricordisamoa <ricordisamoa(a)openmailbox.org>
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.
Change subject: Allow titletranslate.translate page to be None
......................................................................
Allow titletranslate.translate page to be None
60c01fa552 introduced a dependency in titletranslate.translate on
its page parameter, however that parameter can be None.
Fix the spec of the method to indicate it can be None, and
also rewrite the only invocation, in interwiki.py, so it is more
easily understandable.
Also deprecate unused family parameter.
Bug: T75934
Change-Id: Ifca8a1c259d34e8c43c6ab331d2dc5196f3bfb44
---
M pywikibot/titletranslate.py
M scripts/interwiki.py
2 files changed, 26 insertions(+), 22 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/titletranslate.py b/pywikibot/titletranslate.py
index f7f7b55..c535815 100644
--- a/pywikibot/titletranslate.py
+++ b/pywikibot/titletranslate.py
@@ -3,7 +3,7 @@
#
# (C) Rob W.W. Hooft, 2003
# (C) Yuri Astrakhan, 2005
-# (C) Pywikibot team, 2003-2014
+# (C) Pywikibot team, 2003-2015
#
# Distributed under the terms of the MIT license.
#
@@ -15,11 +15,14 @@
import pywikibot
import pywikibot.date as date
+
from pywikibot import config
+from pywikibot.tools import deprecated_args
-def translate(page, hints=None, auto=True, removebrackets=False, site=None,
- family=None):
+@deprecated_args(family=None)
+def translate(page=None, hints=None, auto=True, removebrackets=False,
+ site=None):
"""
Return a list of links to pages on other sites based on hints.
@@ -32,10 +35,12 @@
"""
result = set()
+
+ assert page or site
+
if site is None and page:
site = page.site
- if family is None and site:
- family = site.family
+
if hints:
for h in hints:
if ':' not in h:
@@ -65,13 +70,15 @@
codes = site.family.language_groups[codes]
else:
codes = codes.split(',')
+
for newcode in codes:
if newcode in site.languages():
if newcode != site.code:
+ ns = page.namespace() if page else 0
x = pywikibot.Link(newname,
site.getSite(code=newcode),
- defaultNamespace=page.namespace())
+ defaultNamespace=ns)
result.add(x)
else:
if config.verbose_output:
diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index 33749ea..b8084d7 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -925,24 +925,21 @@
"""Add the given translation hints to the todo list."""
if globalvar.same and self.originPage:
if hints:
- links = titletranslate.translate(
- self.originPage,
- hints=hints + ['all:'],
- auto=globalvar.auto,
- removebrackets=globalvar.hintnobracket)
+ hints += ['all:']
else:
- links = titletranslate.translate(
- self.originPage,
- hints=['all:'],
- auto=globalvar.auto,
- removebrackets=globalvar.hintnobracket)
+ hints = ['all:']
+
+ site = self.originPage.site
else:
- links = titletranslate.translate(
- self.originPage,
- hints=hints,
- auto=globalvar.auto,
- removebrackets=globalvar.hintnobracket,
- site=pywikibot.Site())
+ site = pywikibot.Site()
+
+ links = titletranslate.translate(
+ self.originPage,
+ hints=hints,
+ auto=globalvar.auto,
+ removebrackets=globalvar.hintnobracket,
+ site=site)
+
for link in links:
page = pywikibot.Page(link)
if globalvar.contentsondisk:
--
To view, visit https://gerrit.wikimedia.org/r/222606
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifca8a1c259d34e8c43c6ab331d2dc5196f3bfb44
Gerrit-PatchSet: 6
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
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: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Remove broken code in titletranslate
......................................................................
Remove broken code in titletranslate
The removed code has been broken since September 2005,
with compat revisions b37fad1 and 2207345 which switched
from using date map keys like 'decadesBC' to 'DecadeBC'.
Some of the removed code become invalid in September 2010,
after c96d3ab0, when deprecated data maxyearBC & maxyearAD
in date.py was removed, but was still used by titletranslate.
getPoisonedLinks was added in compat revision 9cd9c1f7e May 2005,
but has never been used in the compat or core codebase.
Bug: T75026
Change-Id: I742ceda1507810fadabb18c4bb76caa3208f5f40
---
M pywikibot/titletranslate.py
1 file changed, 2 insertions(+), 49 deletions(-)
Approvals:
John Vandenberg: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/titletranslate.py b/pywikibot/titletranslate.py
index 5735163..f7f7b55 100644
--- a/pywikibot/titletranslate.py
+++ b/pywikibot/titletranslate.py
@@ -85,12 +85,7 @@
sitelang = page.site.code
dictName, value = date.getAutoFormat(sitelang, page.title())
if dictName:
- if not (dictName == 'yearsBC' and
- sitelang in date.maxyearBC and
- value > date.maxyearBC[sitelang]) or \
- (dictName == 'yearsAD' and
- sitelang in date.maxyearAD and
- value > date.maxyearAD[sitelang]):
+ if True:
pywikibot.output(
u'TitleTranslate: %s was recognized as %s with value %d'
% (page.title(), dictName, value))
@@ -98,15 +93,7 @@
if entryLang not in site.languages():
continue
if entryLang != sitelang:
- if (dictName == 'yearsBC' and
- entryLang in date.maxyearBC and
- value > date.maxyearBC[entryLang]):
- pass
- elif (dictName == 'yearsAD' and
- entryLang in date.maxyearAD and
- value > date.maxyearAD[entryLang]):
- pass
- else:
+ if True:
newname = entry(value)
x = pywikibot.Link(
newname,
@@ -114,37 +101,3 @@
fam=site.family))
result.add(x)
return list(result)
-
-bcDateErrors = [u'[[ko:%d년]]']
-
-
-def appendFormatedDates(result, dictName, value):
- for code, func in date.formats[dictName].items():
- result.append(u'[[%s:%s]]' % (code, func(value)))
-
-
-def getPoisonedLinks(pl):
- """Return a list of known corrupted links that should be removed if seen."""
- result = []
- pywikibot.output(u'getting poisoned links for %s' % pl.title())
- dictName, value = date.getAutoFormat(pl.site.code, pl.title())
- if dictName is not None:
- pywikibot.output(u'date found in %s' % dictName)
- # errors in year BC
- if dictName in date.bcFormats:
- for fmt in bcDateErrors:
- result.append(fmt % value)
- # i guess this is like friday the 13th for the years
- if value == 398 and dictName == 'yearsBC':
- appendFormatedDates(result, dictName, 399)
- if dictName == 'yearsBC':
- appendFormatedDates(result, 'decadesBC', value)
- appendFormatedDates(result, 'yearsAD', value)
- if dictName == 'yearsAD':
- appendFormatedDates(result, 'decadesAD', value)
- appendFormatedDates(result, 'yearsBC', value)
- if dictName == 'centuriesBC':
- appendFormatedDates(result, 'decadesBC', value * 100 + 1)
- if dictName == 'centuriesAD':
- appendFormatedDates(result, 'decadesAD', value * 100 + 1)
- return result
--
To view, visit https://gerrit.wikimedia.org/r/219314
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I742ceda1507810fadabb18c4bb76caa3208f5f40
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
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: Ricordisamoa <ricordisamoa(a)openmailbox.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Yurik <yurik(a)wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #2551
Status: Broken
Duration: 28 minutes and 37 seconds
Commit: b866f7d (master)
Author: John Vandenberg
Message: Split script tests into help and simulate tests
List 'version' as an unrunable script, as it does
not support global options.
Four auto-run scripts are moved from expected failures
to be allowed failures, as their output is highly
variable depending on existence of site templates or
categories, and may not emit output within the time
given on wikis with large backlogs.
Change-Id: I7f29107f2d4db5e6c639f349e83ce4705d478034
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/00eb20fb0b3c...b866f7d1…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/71537419
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications