jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/502192 )
Change subject: [tests] Skip some tests for wpbeta and wsbeta
......................................................................
[tests] Skip some tests for wpbeta and wsbeta
Skip test_recentchanges_default method of
pagegenerators_tests.TestFactoryGenerator due to too
many autoblocked users. Tests fails for a long time.
Bug: T219780
Change-Id: I24be60fea1799dbb709dee8ec5bdca1e7da1b500
---
M tests/pagegenerators_tests.py
1 file changed, 3 insertions(+), 0 deletions(-)
Approvals:
D3r1ck01: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index b7c622f..6af2673 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -1015,6 +1015,9 @@
def test_recentchanges_default(self):
"""Test recentchanges generator with default namespace setting."""
+ if self.site.family.name in ('wpbeta', 'wsbeta'):
+ self.skipTest('Skipping {} due to too many autoblocked users'
+ .format(self.site))
gf = pagegenerators.GeneratorFactory(site=self.site)
gf.handleArg('-recentchanges:50')
gen = gf.getCombinedGenerator()
--
To view, visit https://gerrit.wikimedia.org/r/502192
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I24be60fea1799dbb709dee8ec5bdca1e7da1b500
Gerrit-Change-Number: 502192
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Framawiki <framawiki(a)tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/505456 )
Change subject: [cleanup] Remove wikiapiary from family_file dictionary
......................................................................
[cleanup] Remove wikiapiary from family_file dictionary
- wikiapiary.com is no longer available and was never used for tests.
Remove their registration; see https://meta.wikimedia.org/wiki/Interwiki_map
- Update doc string for register_family_file.
Change-Id: Idc5bfceb08763b7023000d49587b4d91520b5a46
---
M pywikibot/config2.py
1 file changed, 5 insertions(+), 2 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/config2.py b/pywikibot/config2.py
index 78afa27..e155e60 100644
--- a/pywikibot/config2.py
+++ b/pywikibot/config2.py
@@ -399,7 +399,11 @@
def register_family_file(family_name, file_path):
- """Register a single family class file."""
+ """Register a single family class file.
+
+ Parameter file_path may be a path or an url.
+ family.AutoFamily function is used when the url is given.
+ """
usernames[family_name] = {}
sysopnames[family_name] = {}
disambiguation_comment[family_name] = {}
@@ -418,7 +422,6 @@
# Get the names of all known families, and initialize with empty dictionaries.
# ‘families/’ is a subdirectory of the directory in which config2.py is found.
register_families_folder(os.path.join(os.path.dirname(__file__), 'families'))
-register_family_file('wikiapiary', 'https://wikiapiary.com')
# Set to True to override the {{bots}} exclusion protocol (at your own risk!)
ignore_bot_templates = False
--
To view, visit https://gerrit.wikimedia.org/r/505456
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Idc5bfceb08763b7023000d49587b4d91520b5a46
Gerrit-Change-Number: 505456
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
Gerrit-CC: Framawiki <framawiki(a)tools.wmflabs.org>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/505459 )
Change subject: [python 3.8] threading.Thread.isAlive() method is deprecated
......................................................................
[python 3.8] threading.Thread.isAlive() method is deprecated
The isAlive() method of threading.Thread has been deprecated.
The renaming to is_alive() was done in python 2.6
Change-Id: I7322d86a73133fa28f97d3b1e0b406fd08645137
---
M pywikibot/__init__.py
M pywikibot/tools/__init__.py
M scripts/weblinkchecker.py
3 files changed, 5 insertions(+), 5 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 2caa6f0..a4cbfdc 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -1366,7 +1366,7 @@
'{lightblue}Waiting for {num} pages to be put. '
'Estimated time remaining: {sec}{default}', num=num, sec=sec))
- while _putthread.isAlive() and page_put_queue.qsize() > 0:
+ while _putthread.is_alive() and page_put_queue.qsize() > 0:
try:
_putthread.join(1)
except KeyboardInterrupt:
@@ -1400,7 +1400,7 @@
def async_request(request, *args, **kwargs):
"""Put a request on the queue, and start the daemon if necessary."""
- if not _putthread.isAlive():
+ if not _putthread.is_alive():
try:
page_put_queue.mutex.acquire()
try:
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py
index 4515301..8bd43d5 100644
--- a/pywikibot/tools/__init__.py
+++ b/pywikibot/tools/__init__.py
@@ -842,7 +842,7 @@
def __iter__(self):
"""Iterate results from the queue."""
- if not self.isAlive() and not self.finished.isSet():
+ if not self.is_alive() and not self.finished.isSet():
self.start()
# if there is an item in the queue, yield it, otherwise wait
while not self.finished.isSet():
@@ -985,7 +985,7 @@
"""Return the number of alive threads and delete all non-alive ones."""
cnt = 0
for item in self[:]:
- if item.isAlive():
+ if item.is_alive():
cnt += 1
else:
self.remove(item)
diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py
index e3d5d69..320c8b8 100755
--- a/scripts/weblinkchecker.py
+++ b/scripts/weblinkchecker.py
@@ -1031,7 +1031,7 @@
# wait until the report thread is shut down; the user can
# interrupt it by pressing CTRL-C.
try:
- while bot.history.reportThread.isAlive():
+ while bot.history.reportThread.is_alive():
time.sleep(0.1)
except KeyboardInterrupt:
pywikibot.output('Report thread interrupted.')
--
To view, visit https://gerrit.wikimedia.org/r/505459
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7322d86a73133fa28f97d3b1e0b406fd08645137
Gerrit-Change-Number: 505459
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Framawiki <framawiki(a)tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/505409 )
Change subject: Implement create_short_link function to use Extension:UrlShortener
......................................................................
Implement create_short_link function to use Extension:UrlShortener
Implement create_short_link in APISite then in BasePage.
Bug: T220876
Change-Id: I57280c24e0049cda751bf5646f58079763316b55
---
M pywikibot/family.py
M pywikibot/page.py
M pywikibot/site.py
3 files changed, 52 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/family.py b/pywikibot/family.py
index 5f5c932..97ed83e 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -933,6 +933,10 @@
# 'pt': { '_default': [0]}
# }
+ # Some wiki farms have UrlShortener extension enabled only on the main
+ # site. This value can specify this last one with (lang, family) tuple.
+ shared_urlshortner_wiki = None
+
_families = {}
def __getattribute__(self, name):
@@ -1676,6 +1680,10 @@
# wikibase code and item number:
disambcatname = {'wikidata': 'Q1982926'}
+ # UrlShortener extension is only usable on metawiki, and this wiki can
+ # process links to all WM domains.
+ shared_urlshortner_wiki = ('meta', 'meta')
+
@classproperty
def domain(cls):
"""Domain property."""
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 05c05f8..b4cfd5f 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -2212,6 +2212,33 @@
"""
return self.content_model == 'flow-board'
+ def create_short_link(self, permalink=False, with_protocol=False):
+ """
+ Return a shortened link that points to that page.
+
+ If shared_urlshortner_wiki is defined in family config, it'll use
+ that site to create the link instead of the current wiki.
+
+ @param permalink: If true, the link will point to the actual revision
+ of the page.
+ @type permalink: bool
+ @param with_protocol: If true, the link will have https propotol
+ prepend.
+ @type with_protocol: bool
+ @return: The reduced link.
+ @rtype: str
+ """
+ wiki = self.site
+ if self.site.family.shared_urlshortner_wiki:
+ wiki = pywikibot.Site(*self.site.family.shared_urlshortner_wiki)
+
+ url = self.permalink() if permalink else self.full_url()
+
+ link = wiki.create_short_link(url)
+ if with_protocol:
+ return '{}://{}'.format(wiki.protocol(), link)
+ return link
+
# ####### DEPRECATED METHODS ########
@deprecated('Site.encoding()', since='20090307')
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 0373533..12de127 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -7454,6 +7454,23 @@
gen.set_maximum_items(total)
return gen
+ @need_extension('UrlShortener')
+ def create_short_link(self, url):
+ """
+ Return a shortened link.
+
+ Note that on Wikimedia wikis only metawiki supports this action,
+ and this wiki can process links to all WM domains.
+
+ @param url: The link to reduce, with propotol prefix.
+ @type url: str
+ @return: The reduced link, without protocol prefix.
+ @rtype: str
+ """
+ req = self._simple_request(action='shortenurl', url=url)
+ data = req.submit()
+ return data['shortenurl']['shorturl']
+
# aliases for backwards compatibility
isBlocked = redirect_func(is_blocked, old_name='isBlocked',
class_name='APISite', since='20141218')
--
To view, visit https://gerrit.wikimedia.org/r/505409
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I57280c24e0049cda751bf5646f58079763316b55
Gerrit-Change-Number: 505409
Gerrit-PatchSet: 2
Gerrit-Owner: Framawiki <framawiki(a)tools.wmflabs.org>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
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: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/490019 )
Change subject: [tests] pytest 5.0 will no longer support Python 2.7 and 3.4
......................................................................
[tests] pytest 5.0 will no longer support Python 2.7 and 3.4
Bug: T215874
Change-Id: Ieee94da641889ab22eac1bc8b4566d5f621b4363
---
M dev-requirements.txt
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
D3r1ck01: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/dev-requirements.txt b/dev-requirements.txt
index b08fd04..1aeeeec 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,6 +1,7 @@
# This is a PIP 6+ requirements file for development dependencies
#
-pytest>=3.6.0
+pytest>=3.6.0,<5.0.0 ; python_full_version < 3.5
+pytest>=3.6.0 ; python_full_version >= 3.5
pytest-timeout
pytest-runner
pytest-cov>=2.6.1
--
To view, visit https://gerrit.wikimedia.org/r/490019
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ieee94da641889ab22eac1bc8b4566d5f621b4363
Gerrit-Change-Number: 490019
Gerrit-PatchSet: 6
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/496760 )
Change subject: [bugfix] Add plural support to archivebot-older-than
......................................................................
[bugfix] Add plural support to archivebot-older-than
Bug: T218389
Change-Id: I4eeeb489823318868ec70d4f114195f9b0a6925e
---
M archivebot/en.json
M archivebot/qqq.json
2 files changed, 4 insertions(+), 3 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/archivebot/en.json b/archivebot/en.json
index ef93ca3..45efb20 100644
--- a/archivebot/en.json
+++ b/archivebot/en.json
@@ -7,6 +7,6 @@
"archivebot-archive-full": "(ARCHIVE FULL)",
"archivebot-archive-summary": "Bot: Archiving %(count)d {{PLURAL:%(count)d|thread|threads}} from [[%(from)s]]",
"archivebot-archiveheader": "{{talk archive}}",
- "archivebot-older-than": "older than %(duration)s",
+ "archivebot-older-than": "{{PLURAL:%(count)d|older}} than %(duration)s",
"archivebot-page-summary": "Bot: Archiving %(count)d {{PLURAL:%(count)d|thread|threads}} (%(why)s) to %(archives)s"
}
diff --git a/archivebot/qqq.json b/archivebot/qqq.json
index ac3dd90..389644b 100644
--- a/archivebot/qqq.json
+++ b/archivebot/qqq.json
@@ -5,12 +5,13 @@
"McDutchie",
"Shirayuki",
"Xqt",
- "Purodha"
+ "Purodha",
+ "Dvorapa"
]
},
"archivebot-archive-full": "Appended to the summary.",
"archivebot-archive-summary": "Summary message when the bot adds threads to the archive",
"archivebot-archiveheader": "{{doc-important|Only use your deletion template like <code><nowiki>{{talk archive}}</nowiki></code> which exist on your local project.}}\nNOTE TO TRANSLATOR: This should only be translated by someone on the Wikipedia of your language code. Thank you.\n\nTemplate that will be put on new archive pages as the header.\n\nNOTE: If this system message is not given for a language code, an archiving bot might not be supported on your site.",
- "archivebot-older-than": "\"duration\" is the localized form of the elapsed time.\n{{Identical|Older than}}",
+ "archivebot-older-than": "\"duration\" is the localized form of the elapsed time.\n{{Identical|Older than}}\n\"count\" can be used to make a plural from \"older\"",
"archivebot-page-summary": "Summary message when the bot removes threads from a talk page for archiving"
}
--
To view, visit https://gerrit.wikimedia.org/r/496760
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/i18n
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4eeeb489823318868ec70d4f114195f9b0a6925e
Gerrit-Change-Number: 496760
Gerrit-PatchSet: 6
Gerrit-Owner: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Framawiki <framawiki(a)tools.wmflabs.org>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia(a)gmail.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Whym <whym(a)whym.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/501894 )
Change subject: [cleanup] Remove unimplemented option
......................................................................
[cleanup] Remove unimplemented option
-overwrite option is not implemented yet.
Task T220305 is created for this feature.
Change-Id: I61cbaa0fb1084fd25e5b613c7a7de043fbb0a47c
---
M scripts/create_categories.py
1 file changed, 2 insertions(+), 5 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/create_categories.py b/scripts/create_categories.py
index 3111b86..e2dbb25 100755
--- a/scripts/create_categories.py
+++ b/scripts/create_categories.py
@@ -10,8 +10,6 @@
-always Don't ask, just do the edit.
--overwrite (not implemented yet).
-
-parent The name of the parent category.
-basename The base to be used for the new category names.
@@ -32,8 +30,8 @@
"""
#
# (C) Multichill, 2011
-# (C) xqt, 2011-2018
-# (c) Pywikibot team, 2013-2018
+# (C) xqt, 2011-2019
+# (c) Pywikibot team, 2013-2019
#
# Distributed under the terms of the MIT license.
#
@@ -71,7 +69,6 @@
ignore_save_related_errors=True,
ignore_server_errors=True)
else:
- # FIXME: Add overwrite option
pywikibot.output('{} already exists, skipping'
.format(newpage.title()))
--
To view, visit https://gerrit.wikimedia.org/r/501894
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I61cbaa0fb1084fd25e5b613c7a7de043fbb0a47c
Gerrit-Change-Number: 501894
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Multichill <maarten(a)mdammers.nl>
Gerrit-Reviewer: jenkins-bot (75)