jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] WikibasePage: Allow saving wikibase pages without mwpfh
......................................................................
[FIX] WikibasePage: Allow saving wikibase pages without mwpfh
Bug: 69664
Change-Id: I086dcaa88a1cae61ffa3a4811db9948cc34f9167
---
M pywikibot/page.py
1 file changed, 14 insertions(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index a9ca948..13a5010 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -2779,6 +2779,20 @@
return False
return 'lastrevid' in self._content
+ def botMayEdit(self):
+ """
+ Return whether bots may edit this page.
+
+ Because there is currently no system to mark a page that it shouldn't
+ be edited by bots on Wikibase pages it always returns True. The content
+ of the page is not text but a dict, the original way (to search for a
+ template) doesn't apply.
+
+ @return: True
+ @rtype: boolean
+ """
+ return True
+
def get(self, force=False, *args, **kwargs):
"""
Fetch all page data, and cache it.
--
To view, visit https://gerrit.wikimedia.org/r/161201
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I086dcaa88a1cae61ffa3a4811db9948cc34f9167
Gerrit-PatchSet: 1
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: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] Remove 'PY3' switch
......................................................................
[IMPROV] Remove 'PY3' switch
Because Python 3 wasn't really supported until know, it was only
possible to run it with Python 3 if 'PY3' was set to '1'.
Change-Id: If0251bd5c9666e79a273c06b3ef4a3ea7995b0bf
---
M .travis.yml
M pwb.py
M setup.py
3 files changed, 10 insertions(+), 22 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.travis.yml b/.travis.yml
index 918f5f1..013a1b9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -32,7 +32,6 @@
- python setup.py install
- cd ../..
- - if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then export PY3=1; fi
- python -c "import setuptools; print(setuptools.__version__)"
script:
diff --git a/pwb.py b/pwb.py
index 0423435..66b3aa0 100644
--- a/pwb.py
+++ b/pwb.py
@@ -78,23 +78,16 @@
#### end of snippet
-if not os.environ.get("PY3", False):
- if sys.version_info[0] != 2:
- raise RuntimeError("ERROR: Pywikibot only runs under Python 2")
- if sys.version_info < (2, 6, 5):
- raise RuntimeError("ERROR: Pywikibot only runs under Python 2.6.5 "
- "or higher")
-else:
- if sys.version_info[0] not in (2, 3):
- raise RuntimeError("ERROR: Pywikibot only runs under Python 2 "
- "or Python 3")
- version = tuple(sys.version_info)[:3]
- if version < (2, 6, 5):
- raise RuntimeError("ERROR: Pywikibot only runs under Python 2.6.5 "
- "or higher")
- if version >= (3, ) and version < (3, 3):
- raise RuntimeError("ERROR: Pywikibot only runs under Python 3.3 "
- "or higher")
+if sys.version_info[0] not in (2, 3):
+ raise RuntimeError("ERROR: Pywikibot only runs under Python 2 "
+ "or Python 3")
+version = tuple(sys.version_info)[:3]
+if version < (2, 6, 5):
+ raise RuntimeError("ERROR: Pywikibot only runs under Python 2.6.5 "
+ "or higher")
+if version >= (3, ) and version < (3, 3):
+ raise RuntimeError("ERROR: Pywikibot only runs under Python 3.3 "
+ "or higher")
rewrite_path = os.path.dirname(sys.argv[0])
if not os.path.isabs(rewrite_path):
diff --git a/setup.py b/setup.py
index 3c75371..22967ed 100644
--- a/setup.py
+++ b/setup.py
@@ -57,10 +57,6 @@
dependencies.append('ordereddict')
if sys.version_info[0] == 3:
- if not os.environ.get('PY3', False):
- # use setup.py test --python3ok to run tests
- print("ERROR: Pywikibot only runs under Python 2")
- sys.exit(1)
if sys.version_info[1] < 3:
print("ERROR: Python 3.3 or higher is required!")
sys.exit(1)
--
To view, visit https://gerrit.wikimedia.org/r/161113
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If0251bd5c9666e79a273c06b3ef4a3ea7995b0bf
Gerrit-PatchSet: 1
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: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] Typo in aspects.py doubling the word 'not'
......................................................................
[FIX] Typo in aspects.py doubling the word 'not'
Change-Id: Ie3b06b7756299a52f51681dea79c07ff0198b850
---
M tests/aspects.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/aspects.py b/tests/aspects.py
index d6c6f18..08783fc 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -557,7 +557,7 @@
if (hasattr(cls, 'repo') and
cls.repo != site['site'].data_repository()):
raise Exception(
- '%s: sites do not not all have the same data repository'
+ '%s: sites do not all have the same data repository'
% cls.__name__)
cls.repo = site['site'].data_repository()
--
To view, visit https://gerrit.wikimedia.org/r/161114
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie3b06b7756299a52f51681dea79c07ff0198b850
Gerrit-PatchSet: 1
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: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Archivebot: Add 'isoyear' and 'isoweek'
......................................................................
Archivebot: Add 'isoyear' and 'isoweek'
Change-Id: I6b949dc73076493d927be1b2a42064d41ee210d2
---
M scripts/archivebot.py
1 file changed, 15 insertions(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index b56c6c5..015f924 100644
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -56,11 +56,24 @@
%(counter)d the current value of the counter
%(year)d year of the thread being archived
+%(isoyear)d ISO year of the thread being archived
+%(isoweek)d ISO week number of the thread being archived
%(quarter)d quarter of the year of the thread being archived
%(month)d month (as a number 1-12) of the thread being archived
%(monthname)s English name of the month above
%(monthnameshort)s first three letters of the name above
%(week)d week number of the thread being archived
+
+The ISO calendar starts with the Monday of the week which has at least four
+days in the new Gregorian calendar. If January 1st is between Monday and
+Thursday (including), the first week of that year started the Monday of that
+week, which is in the year before if January 1st is not a Monday. If it's
+between Friday or Sunday (including) the following week is then the first week
+of the year. So up to three days are still counted as the year before.
+
+See also:
+ - http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
+ - https://docs.python.org/3.4/library/datetime.html#datetime.date.isocalendar
Options (may be omitted):
-help show this help message and exit
@@ -456,6 +469,8 @@
params = {
'counter': arch_counter,
'year': t.timestamp.year,
+ 'isoyear': t.timestamp.isocalendar()[0],
+ 'isoweek': t.timestamp.isocalendar()[1],
'quarter': int(ceil(float(t.timestamp.month) / 3)),
'month': t.timestamp.month,
'monthname': self.month_num2orig_names[t.timestamp.month]['long'],
--
To view, visit https://gerrit.wikimedia.org/r/159094
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6b949dc73076493d927be1b2a42064d41ee210d2
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Danmichaelo <danmichaelo(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: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
XZise has submitted this change and it was merged.
Change subject: Replace 'return' with a proper SkipTest wrt mwpfh
......................................................................
Replace 'return' with a proper SkipTest wrt mwpfh
Change-Id: Ib73fe09c1510e80b43b4da2179579bf6581aad86
---
M tests/textlib_tests.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
XZise: Looks good to me, approved
diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index d4586e5..ba93f01 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -52,7 +52,7 @@
def testExtractTemplates(self):
if not (pywikibot.config.use_mwparserfromhell and mwparserfromhell):
- return # We'll test the regex function in the test below
+ raise unittest.SkipTest('mwparserfromhell not available or enabled')
func = textlib.extract_templates_and_params # It's really long.
self.assertEqual(func('{{a}}'), [('a', {})])
self.assertEqual(func('{{a|b=c}}'), [('a', {'b': 'c'})])
--
To view, visit https://gerrit.wikimedia.org/r/160934
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib73fe09c1510e80b43b4da2179579bf6581aad86
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: 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: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Token tests depend on a logged in user
......................................................................
Token tests depend on a logged in user
Change-Id: I04e9da1ea5732ebd6fe0019016ba581e702037a5
---
M tests/site_tests.py
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 7835288..592751b 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -31,6 +31,7 @@
"""Test cases for Site deprecated methods."""
cached = True
+ user = True
def test_live_version(self):
"""Test live_version."""
--
To view, visit https://gerrit.wikimedia.org/r/160879
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I04e9da1ea5732ebd6fe0019016ba581e702037a5
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: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] Python 3: Use chr instead of unichr in Python 3
......................................................................
[FIX] Python 3: Use chr instead of unichr in Python 3
The change in page.py is different than the normal change, because
Python 3 doesn't suffer from the problem that it might not support
charpoints above 2¹⁶.
Change-Id: Id49f6dd0aa81a8b915f20453dbb679fd840a9a80
---
M pywikibot/page.py
M scripts/featured.py
2 files changed, 8 insertions(+), 2 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 39cb3ad..a9ca948 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -4410,8 +4410,10 @@
except KeyError:
pass
if unicodeCodepoint and unicodeCodepoint not in ignore:
- # solve narrow Python build exception (UTF-16)
- if unicodeCodepoint > sys.maxunicode:
+ if sys.version_info[0] > 2:
+ result += chr(unicodeCodepoint)
+ elif unicodeCodepoint > sys.maxunicode:
+ # solve narrow Python 2 build exception (UTF-16)
unicode_literal = lambda n: eval(r"u'\U%08x'" % n)
result += unicode_literal(unicodeCodepoint)
else:
diff --git a/scripts/featured.py b/scripts/featured.py
index 6893f96..98cb0a7 100644
--- a/scripts/featured.py
+++ b/scripts/featured.py
@@ -64,11 +64,15 @@
import pickle
import re
+import sys
import pywikibot
from pywikibot import i18n, textlib
from pywikibot.pagegenerators import PreloadingGenerator
from pywikibot.config2 import LS # line separator
+if sys.version_info[0] > 2:
+ unichr = chr
+
def CAT(site, name, hide):
name = site.namespace(14) + ':' + name
--
To view, visit https://gerrit.wikimedia.org/r/160804
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id49f6dd0aa81a8b915f20453dbb679fd840a9a80
Gerrit-PatchSet: 1
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: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>