jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/489169 )
Change subject: [spelling] Fix spelling mistakes
......................................................................
[spelling] Fix spelling mistakes
Change-Id: I4e277c03b394b987624c7ce2b1704acb4f466f34
---
M pywikibot/bot.py
M pywikibot/comms/eventstreams.py
M pywikibot/date.py
M pywikibot/page.py
M pywikibot/tools/djvu.py
M pywikibot/userinterfaces/transliteration.py
M scripts/followlive.py
M scripts/replace.py
M scripts/table2wiki.py
M tests/djvu_tests.py
M tests/site_detect_tests.py
M tests/site_tests.py
12 files changed, 29 insertions(+), 29 deletions(-)
Approvals:
D3r1ck01: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index eebfb10..ae1e335 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -48,7 +48,7 @@
used.
"""
#
-# (C) Pywikibot team, 2008-2018
+# (C) Pywikibot team, 2008-2019
#
# Distributed under the terms of the MIT license.
#
@@ -1071,7 +1071,7 @@
"""
messages = []
if exception:
- messages.append('An error occured: "{}".'.format(exception))
+ messages.append('An error occurred: "{}".'.format(exception))
if missing_generator:
messages.append(
'Unable to execute script because no generator was defined.')
diff --git a/pywikibot/comms/eventstreams.py b/pywikibot/comms/eventstreams.py
index 8181194..710bebd 100644
--- a/pywikibot/comms/eventstreams.py
+++ b/pywikibot/comms/eventstreams.py
@@ -9,7 +9,7 @@
"""
#
# (C) xqt, 2017-2018
-# (C) Pywikibot team, 2017-2018
+# (C) Pywikibot team, 2017-2019
#
# Distributed under the terms of the MIT license.
#
@@ -321,7 +321,7 @@
elif event.event == 'error':
warning('Encountered error: {0}'.format(event.data))
else:
- warning('Unknown event {0} occured.'.format(event.event))
+ warning('Unknown event {0} occurred.'.format(event.event))
else:
debug('{0}: Stopped iterating due to '
'exceeding item limit.'
diff --git a/pywikibot/date.py b/pywikibot/date.py
index 96ec25b..683a37f 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -7,7 +7,7 @@
# (C) Andre Engels, 2004-2005
# (C) Yuri Astrakhan, 2005-2006 (<Firstname><Lastname>@gmail.com)
# (years/decades/centuries/millenniums str <=> int conversions)
-# (C) Pywikibot team, 2004-2018
+# (C) Pywikibot team, 2004-2019
#
# Distributed under the terms of the MIT license.
#
@@ -376,7 +376,7 @@
Returns a compiled regex object and a list of digit decoders.
"""
if pattern not in _escPtrnCache2:
- newPattern = '^' # begining of the string
+ newPattern = '^' # beginning of the string
strPattern = ''
decoders = []
for s in _reParameters.split(pattern):
@@ -2140,7 +2140,7 @@
waMonthNames = ['djanvî', 'fevrî', 'måss', 'avri', 'may', 'djun', 'djulete',
'awousse', 'setimbe', 'octôbe', 'nôvimbe', 'decimbe']
-# For month names begining with a consonant...
+# For month names beginning with a consonant...
for i in (0, 1, 2, 4, 5, 6, 8, 10, 11):
formats[dayMnthFmts[i]]['wa'] = eval(
'lambda m: multi(m, ['
@@ -2150,7 +2150,7 @@
'(lambda v: dh_dayOfMnth(v, "%%d di %s"), alwaysTrue)])'
% (waMonthNames[i], waMonthNames[i], waMonthNames[i]))
-# For month names begining with a vowel...
+# For month names beginning with a vowel...
for i in (3, 7, 9):
formats[dayMnthFmts[i]]['wa'] = eval(
'lambda m: multi(m, ['
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 1fbd1c2..f3c1421 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -2722,7 +2722,7 @@
return sha1 == revision.sha1
else:
pywikibot.warning(
- 'Unsuccesfull request (%s): %s' % (req.status, req.uri))
+ 'Unsuccessfull request (%s): %s' % (req.status, req.uri))
return False
def globalusage(self, total=None):
diff --git a/pywikibot/tools/djvu.py b/pywikibot/tools/djvu.py
index 381d816..67a28e2 100644
--- a/pywikibot/tools/djvu.py
+++ b/pywikibot/tools/djvu.py
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
"""Wrapper around djvulibre to access djvu files properties and content."""
#
-# (C) Pywikibot team, 2015-2018
+# (C) Pywikibot team, 2015-2019
#
# Distributed under the terms of the MIT license.
#
@@ -63,7 +63,7 @@
"""Wrapper around djvulibre to access djvu files properties and content.
- Perform file existance checks.
+ Perform file existence checks.
Control characters in djvu text-layer are converted for convenience
(see http://djvu.sourceforge.net/doc/man/djvused.html for control chars
diff --git a/pywikibot/userinterfaces/transliteration.py b/pywikibot/userinterfaces/transliteration.py
index 1aae431..739e2c4 100644
--- a/pywikibot/userinterfaces/transliteration.py
+++ b/pywikibot/userinterfaces/transliteration.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Module to transliterate text."""
#
-# (C) Pywikibot team, 2006-2018
+# (C) Pywikibot team, 2006-2019
#
# Distributed under the terms of the MIT license.
#
@@ -119,7 +119,7 @@
'х': 'kh', 'Ц': 'C', 'ц': 'c', 'Ч': 'Ch', 'ч': 'ch', 'Ш': 'Sh', 'ш': 'sh',
'Щ': 'Shch', 'щ': 'shch', 'Ь': "'", 'ь': "'", 'Ъ': '"', 'ъ': '"',
'Ю': 'Yu', 'ю': 'yu', 'Я': 'Ya', 'я': 'ya', 'Х': 'Kh', 'Χ': 'Kh',
- # Additional Cyrillic letters, most occuring in only a few languages
+ # Additional Cyrillic letters, most occurring in only a few languages
'Ы': 'Y', 'ы': 'y', 'Ё': 'Ë', 'ё': 'ë', 'Э': 'È', 'Ѐ': 'È', 'э': 'è',
'ѐ': 'è', 'І': 'I', 'і': 'i', 'Ї': 'Ji', 'ї': 'ji', 'Є': 'Je', 'є': 'je',
'Ґ': 'G', 'Ҝ': 'G', 'ґ': 'g', 'ҝ': 'g', 'Ђ': 'Dj', 'ђ': 'dj', 'Љ': 'Lj',
diff --git a/scripts/followlive.py b/scripts/followlive.py
index e18b5ad..f4abc3f 100644
--- a/scripts/followlive.py
+++ b/scripts/followlive.py
@@ -458,7 +458,7 @@
{'content': self.content}))
except pywikibot.EditConflict:
pywikibot.output(
- 'An edit conflict occured! Automatically retrying')
+ 'An edit conflict occurred! Automatically retrying')
self.handle_bad_page(self)
return
if answer == '':
@@ -526,7 +526,7 @@
@type page: pywikibot.Page
@ivar date: creation date
@type date: str in ISO8601 format
- @ivar length: content lenght
+ @ivar length: content length
@type length: int
@ivar user: creator of page
@type user: pywikibot.User
diff --git a/scripts/replace.py b/scripts/replace.py
index 9275494..cb625fa 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -137,7 +137,7 @@
"""
#
# (C) Daniel Herding, 2004-2012
-# (C) Pywikibot team, 2004-2018
+# (C) Pywikibot team, 2004-2019
#
# Distributed under the terms of the MIT license.
#
@@ -672,7 +672,7 @@
return new_text
def _count_changes(self, page, err):
- """Count succesfully changed pages; log changed titles for display."""
+ """Count successfully changed pages; log changed titles for display."""
# This is an async put callback
if not isinstance(err, Exception):
self.changed_pages += 1
@@ -890,7 +890,7 @@
'text-contains': [],
'inside': [],
'inside-tags': [],
- 'require-title': [], # using a seperate requirements dict needs some
+ 'require-title': [], # using a separate requirements dict needs some
} # major refactoring of code.
# Should the elements of 'replacements' and 'exceptions' be interpreted
diff --git a/scripts/table2wiki.py b/scripts/table2wiki.py
index 5926835..97e9f93 100644
--- a/scripts/table2wiki.py
+++ b/scripts/table2wiki.py
@@ -103,7 +103,7 @@
If the table already is a
wiki table or contains a nested wiki table, tries to beautify it.
- Returns the converted table, the number of warnings that occured and
+ Returns the converted table, the number of warnings that occurred and
a list containing these warnings.
Hint: if you give an entire page text as a parameter instead of a table
only, this function will convert all HTML tables and will also try to
@@ -177,7 +177,7 @@
r'\r\n! \g<header>\r\n', new_table)
if n > 0:
warning_messages.append(
- 'WARNING: found <th> without </th>. ({0} occurences)\n'
+ 'WARNING: found <th> without </th>. ({0} occurrences)\n'
.format(n))
warnings += n
@@ -187,7 +187,7 @@
r'\n!\g<attr> | \g<header>\r\n', new_table)
if n > 0:
warning_messages.append(
- 'WARNING: found <th ...> without </th>. ({0} occurences\n)'
+ 'WARNING: found <th ...> without </th>. ({0} occurrences\n)'
.format(n))
warnings += n
@@ -222,7 +222,7 @@
r'\r\n| \g<cell>\r\n', new_table)
if n > 0:
warning_messages.append(
- '<td> used where </td> was expected. ({0} occurences)\n'
+ '<td> used where </td> was expected. ({0} occurrences)\n'
.format(n))
warnings += n
@@ -233,7 +233,7 @@
if n > 0:
warning_messages.append(
"WARNING: (sorry, bot code unreadable (1). I don't know why "
- 'this warning is given.) ({0} occurences)\n'.format(n))
+ 'this warning is given.) ({0} occurrences)\n'.format(n))
# fail save. sometimes people forget </td>
# <td> without arguments, with missing </td>
@@ -441,7 +441,7 @@
Convert all HTML tables in text to wiki syntax.
Returns the converted text, the number of converted tables and the
- number of warnings that occured.
+ number of warnings that occurred.
"""
text = self.markActiveTables(text)
diff --git a/tests/djvu_tests.py b/tests/djvu_tests.py
index ffc65bb..f4d833a 100644
--- a/tests/djvu_tests.py
+++ b/tests/djvu_tests.py
@@ -3,7 +3,7 @@
"""Unit tests for djvu.py."""
#
-# (C) Pywikibot team, 2015-2018
+# (C) Pywikibot team, 2015-2019
#
# Distributed under the terms of the MIT license.
#
@@ -73,7 +73,7 @@
else:
self.assertEqual(djvu.__unicode__(), expected)
- def test_file_existance(self):
+ def test_file_existence(self):
"""Test file existence checks."""
djvu = DjVuFile(self.file_djvu)
self.assertEqual(os.path.abspath(self.file_djvu), djvu.file)
diff --git a/tests/site_detect_tests.py b/tests/site_detect_tests.py
index 076393f..ec15e58 100644
--- a/tests/site_detect_tests.py
+++ b/tests/site_detect_tests.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Test for site detection."""
#
-# (C) Pywikibot team, 2014-2018
+# (C) Pywikibot team, 2014-2019
#
# Distributed under the terms of the MIT license.
#
@@ -266,7 +266,7 @@
def test_musicbrainz(self):
"""Test http://musicbrainz.org/doc/ which has a page 'api.php'.
- Possible false positive caused by the existance of a page called
+ Possible false positive caused by the existence of a page called
http://musicbrainz.org/doc/api.php.
"""
self.assertNoSite('http://musicbrainz.org/doc/$1')
diff --git a/tests/site_tests.py b/tests/site_tests.py
index e42bee2..86b654f 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -2699,7 +2699,7 @@
total=5))
def test_backlinks_redirects_length(self):
- """Test backlinks redirects lenght."""
+ """Test backlinks redirects length."""
self.assertEqual(len(self.backlinks), 1)
self.assertEqual(len(self.references), 1)
self.assertEqual(len(self.nofollow), 1)
--
To view, visit https://gerrit.wikimedia.org/r/489169
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: I4e277c03b394b987624c7ce2b1704acb4f466f34
Gerrit-Change-Number: 489169
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <alangiderick(a)gmail.com>
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/489142 )
Change subject: config2.py: Remove an unnecessary for loop
......................................................................
config2.py: Remove an unnecessary for loop
_fns is either empty or has a single item. Only run the block of code
if it is not empty and using its only _filename.
Change-Id: I4c1f07405c868d02ca009808cd95d44bbd214f9e
---
M pywikibot/config2.py
1 file changed, 1 insertion(+), 3 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/config2.py b/pywikibot/config2.py
index 8b42641..0baeedf 100644
--- a/pywikibot/config2.py
+++ b/pywikibot/config2.py
@@ -1039,10 +1039,8 @@
if __no_user_config:
if __no_user_config != '2':
warning('Skipping loading of user-config.py.')
- _fns = []
else:
- _fns = [os.path.join(base_dir, 'user-config.py')]
-for _filename in _fns:
+ _filename = os.path.join(base_dir, 'user-config.py')
if os.path.exists(_filename):
_filestatus = os.stat(_filename)
_filemode = _filestatus[0]
--
To view, visit https://gerrit.wikimedia.org/r/489142
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: I4c1f07405c868d02ca009808cd95d44bbd214f9e
Gerrit-Change-Number: 489142
Gerrit-PatchSet: 1
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
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/482535 )
Change subject: [bugfix] import MWSite in generate_family_file.py when needed
......................................................................
[bugfix] import MWSite in generate_family_file.py when needed
generate_family_files_tests.py needs MWSite being imported but it wasn't
since the import was only done when started as script.
Now import the MWSite class when the FamilyFileGenerator class is created.
Bug: T212998
Change-Id: I57c5258913f9b14e3e73de0d05077c873da9c328
---
M generate_family_file.py
1 file changed, 10 insertions(+), 7 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/generate_family_file.py b/generate_family_file.py
index a73e3ec..97eac88 100755
--- a/generate_family_file.py
+++ b/generate_family_file.py
@@ -3,7 +3,7 @@
"""This script generates a family file from a given URL."""
#
# (C) Merlijn van Deen, 2010-2013
-# (C) Pywikibot team, 2010-2018
+# (C) Pywikibot team, 2010-2019
#
# Distributed under the terms of the MIT license
#
@@ -16,6 +16,7 @@
import sys
from os import environ, getenv
+
# creating & retrieving urls
if sys.version_info[0] > 2:
from urllib.parse import urlparse
@@ -30,6 +31,12 @@
def __init__(self, url=None, name=None, dointerwiki=None):
"""Initializer."""
+ # from pywikibot.site_detect import MWSite
+ # when required but disable user-config checks
+ # so the family can be created first,
+ # and then used when generating the user-config
+ self.Wiki = _import_with_no_user_config(
+ 'pywikibot.site_detect').site_detect.MWSite
if url is None:
url = raw_input('Please insert URL to wiki: ')
if name is None:
@@ -45,7 +52,7 @@
"""Main method, generate family file."""
print('Generating family file from ' + self.base_url)
- w = Wiki(self.base_url)
+ w = self.Wiki(self.base_url)
self.wikis[w.lang] = w
print('\n=================================='
'\nAPI url: {w.api}'
@@ -104,7 +111,7 @@
print(' * %s... ' % (lang['prefix']), end='')
if lang['prefix'] not in self.wikis:
try:
- self.wikis[lang['prefix']] = Wiki(lang['url'])
+ self.wikis[lang['prefix']] = self.Wiki(lang['url'])
print('downloaded')
except Exception as e:
print(e)
@@ -211,10 +218,6 @@
if __name__ == '__main__':
- # Disable user-config checks so the family can be created first,
- # and then used when generating the user-config
- Wiki = _import_with_no_user_config(
- 'pywikibot.site_detect').site_detect.MWSite
if len(sys.argv) != 3:
print("""
Usage: {module} <url> <short name>
--
To view, visit https://gerrit.wikimedia.org/r/482535
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: I57c5258913f9b14e3e73de0d05077c873da9c328
Gerrit-Change-Number: 482535
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
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/488295 )
Change subject: Improve and cleanup archivebot.py
......................................................................
Improve and cleanup archivebot.py
- Raise config errors in more cases.
- Code cleanup.
- Fix typos in docs.
Change-Id: I7efdb5ed7a7b21ae8156eee20e452908d955608f
---
M scripts/archivebot.py
1 file changed, 15 insertions(+), 16 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index ed1c0ed..b8a32b7 100755
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -15,7 +15,7 @@
either basing on the thread's name or then name can contain a counter which
will be incremented when the archive reaches a certain size.
-Trancluded template may contain the following parameters:
+Transcluded template may contain the following parameters:
{{TEMPLATE_PAGE
|archive =
@@ -33,13 +33,13 @@
archive Name of the page to which archived threads will be put.
Must be a subpage of the current page. Variables are
supported.
- algo specifies the maximum age of a thread. Must be
+ algo Specifies the maximum age of a thread. Must be
in the form old(<delay>) where <delay> specifies
the age in seconds (s), hours (h), days (d),
- weeks(w), or years (y) like 24h or 5d. Default is
+ weeks (w), or years (y) like 24h or 5d. Default is
old(24h).
counter The current value of a counter which could be assigned as
- variable. Will be actualized by bot. Initial value is 1.
+ variable. Will be updated by bot. Initial value is 1.
maxarchivesize The maximum archive size before incrementing the counter.
Value can be given with appending letter like K or M
which indicates KByte or MByte. Default value is 200K.
@@ -50,7 +50,7 @@
archiveheader Content that will be put on new archive pages as the
header. This parameter supports the use of variables.
Default value is {{talkarchive}}
- key A secret key that (if valid) allows archives to not be
+ key A secret key that (if valid) allows archives not to be
subpages of the page being archived.
Variables below can be used in the value for "archive" in the template above:
@@ -259,6 +259,8 @@
"""
r = re.search(r'(\d+) *([BkKMT]?)', string)
+ if not r:
+ raise MalformedConfigError("Couldn't parse size: {}".format(string))
val, unit = (int(r.group(1)), r.group(2))
if unit == 'M':
val *= 1024
@@ -463,7 +465,7 @@
# This extra info is not desirable when run under the unittest
# framework, which may be run either directly or via setup.py
if pywikibot.calledModuleName() not in ['archivebot_tests', 'setup']:
- pywikibot.output('{} Threads found on {}'
+ pywikibot.output('{} thread(s) found on {}'
.format(len(self.threads), self))
def feed_thread(self, thread, max_archive_size=(250 * 1024, 'B')):
@@ -579,22 +581,19 @@
raise MissingConfigError('Missing or malformed template')
if not self.get_attr('algo', ''):
raise MissingConfigError('Missing argument "algo" in template')
+ if not self.get_attr('archive', ''):
+ raise MissingConfigError('Missing argument "archive" in template')
def feed_archive(self, archive, thread, max_archive_size, params=None):
"""
Feed the thread to one of the archives.
If it doesn't exist yet, create it.
- If archive name is an empty string (or None),
- discard the thread.
- Also checks for security violations.
+ Also check for security violations.
"""
title = archive.title()
page_title = self.page.title()
- if not title:
- return
- if not (self.force
- or page_title + '/' == title[:len(page_title) + 1]
+ if not (self.force or title.startswith(page_title + '/')
or self.key_ok()):
raise ArchiveSecurityError(
'Archive page {} does not start with page title ({})!'
@@ -609,7 +608,7 @@
arch_counter = int(self.get_attr('counter', '1'))
oldthreads = self.page.threads
self.page.threads = []
- whys = []
+ whys = set()
pywikibot.output('Processing {} threads'.format(len(oldthreads)))
for t in oldthreads:
if len(oldthreads) - self.archived_threads \
@@ -646,11 +645,11 @@
if self.feed_archive(archive, t, max_arch_size, params):
arch_counter += 1
self.set_attr('counter', str(arch_counter))
- whys.append(why)
+ whys.add(why)
self.archived_threads += 1
else:
self.page.threads.append(t)
- return set(whys)
+ return whys
def run(self):
"""Process a single DiscussionPage object."""
--
To view, visit https://gerrit.wikimedia.org/r/488295
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: I7efdb5ed7a7b21ae8156eee20e452908d955608f
Gerrit-Change-Number: 488295
Gerrit-PatchSet: 2
Gerrit-Owner: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(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/488067 )
Change subject: download_dump: Handle `get_dump_name()` if there are non-number dirnames
......................................................................
download_dump: Handle `get_dump_name()` if there are non-number dirnames
Handle `get_dump_name()` if there are non-number dirnames like
'latest', etc.
Bug: T184032
Change-Id: If0a39ab4e5f080ebe1963d61c9c9a6f6cdb11574
---
M scripts/maintenance/download_dump.py
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
ArielGlenn: Looks good to me, but someone else must approve
Dvorapa: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/maintenance/download_dump.py b/scripts/maintenance/download_dump.py
index 8347a7a..66c96fc 100644
--- a/scripts/maintenance/download_dump.py
+++ b/scripts/maintenance/download_dump.py
@@ -66,7 +66,9 @@
"""Check if dump file exists locally in a Toolforge server."""
db_path = '/public/dumps/public/{0}/'.format(db_name)
if os.path.isdir(db_path):
- dates = map(int, os.listdir(db_path))
+ dirs = [directory for directory in os.listdir(db_path) if
+ directory.isdigit()]
+ dates = map(int, dirs)
dates = sorted(dates, reverse=True)
for date in dates:
dump_filepath = ('/public/dumps/public/{0}/{1}/{2}-{3}-{4}'
--
To view, visit https://gerrit.wikimedia.org/r/488067
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: If0a39ab4e5f080ebe1963d61c9c9a6f6cdb11574
Gerrit-Change-Number: 488067
Gerrit-PatchSet: 2
Gerrit-Owner: Rafidaslam <rafidteam(a)gmail.com>
Gerrit-Reviewer: ArielGlenn <ariel(a)wikimedia.org>
Gerrit-Reviewer: D3r1ck01 <alangiderick(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/488472 )
Change subject: [doc] Prepare next release
......................................................................
[doc] Prepare next release
Change-Id: I5968a905bc5b79d8eeac575c93956c69c34b99cf
---
M HISTORY.rst
M docs/conf.py
2 files changed, 7 insertions(+), 1 deletion(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/HISTORY.rst b/HISTORY.rst
index d16618f..c15d03a 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -4,6 +4,12 @@
Current release
---------------
+* Bugfixes and improvements
+* Localisation updates
+
+3.0.20190204
+------------
+
* Support python version 3.7
* pagegenerators.py: add -querypage parameter to yield pages provided by any special page (T214234)
* Fix comparison of str, bytes and int literal with
diff --git a/docs/conf.py b/docs/conf.py
index ab3abdc..52a1f7a 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -71,7 +71,7 @@
# The short X.Y version.
version = '3.0'
# The full version, including alpha/beta/rc tags.
-release = '3.0.20190106'
+release = '3.0.20190204'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
--
To view, visit https://gerrit.wikimedia.org/r/488472
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: I5968a905bc5b79d8eeac575c93956c69c34b99cf
Gerrit-Change-Number: 488472
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
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/487477 )
Change subject: [doc] Update HISTORY.rst file
......................................................................
[doc] Update HISTORY.rst file
Change-Id: I33ccefc1828a7e06ca2904ea25f5456dd7b35697
---
M HISTORY.rst
1 file changed, 5 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/HISTORY.rst b/HISTORY.rst
index 0033fb2..d16618f 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -4,6 +4,11 @@
Current release
---------------
+* Support python version 3.7
+* pagegenerators.py: add -querypage parameter to yield pages provided by any special page (T214234)
+* Fix comparison of str, bytes and int literal with
+* site.py: add generic self.querypage() to query SpecialPages
+* echo.Notification has a new event_id property as integer
* Bugfixes and improvements
* Localisation updates
--
To view, visit https://gerrit.wikimedia.org/r/487477
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: I33ccefc1828a7e06ca2904ea25f5456dd7b35697
Gerrit-Change-Number: 487477
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(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/487114 )
Change subject: [tests] Skip site_tests.TestUserContribsWithoutUser for wikia
......................................................................
[tests] Skip site_tests.TestUserContribsWithoutUser for wikia
Wikia does not support ucuserprefix for API:Usercontribs even though
Wikia has version 1.19.24 and userprefix was introduced with 1.13.
Skip this tests for Wikia until the underlying problem is solved
to focus on all other tests.
Bug: T214263
Change-Id: Id387363b6e091940cc93be1b401f951be15f66ad
---
M tests/site_tests.py
1 file changed, 10 insertions(+), 0 deletions(-)
Approvals:
Framawiki: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 6f6dc77..78a7aff 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -1686,6 +1686,16 @@
"""Test site method site.usercontribs() without bot user."""
+ @classmethod
+ def setUpClass(cls):
+ """Skip tests for wikia (T214263)."""
+ super(TestUserContribsWithoutUser, cls).setUpClass()
+ mysite = cls.get_site()
+ if mysite.sitename == 'wikia:wikia':
+ raise unittest.SkipTest(
+ 'Skipping site_tests.TestUserContribsWithoutUser tests for '
+ 'Wikia due to T214263')
+
def test_user_prefix(self):
"""Test the site.usercontribs() method with userprefix."""
mysite = self.get_site()
--
To view, visit https://gerrit.wikimedia.org/r/487114
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: Id387363b6e091940cc93be1b401f951be15f66ad
Gerrit-Change-Number: 487114
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
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: Mpaa <mpaa.wiki(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/487648 )
Change subject: [cleanup] Move the initializer on top of the class
......................................................................
[cleanup] Move the initializer on top of the class
Change-Id: If60f27f06d3311e6830cfbb2a3b12d2631022c08
---
M scripts/unlink.py
1 file changed, 6 insertions(+), 6 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/unlink.py b/scripts/unlink.py
index 00fcaf6..4597d08 100755
--- a/scripts/unlink.py
+++ b/scripts/unlink.py
@@ -21,7 +21,7 @@
descriptions.
"""
#
-# (C) Pywikibot team, 2007-2018
+# (C) Pywikibot team, 2007-2019
#
# Distributed under the terms of the MIT license.
#
@@ -38,11 +38,6 @@
summary_key = 'unlink-unlinking'
- @property
- def summary_parameters(self):
- """Return the title parameter."""
- return {'title': self.pageToUnlink.title()}
-
def __init__(self, pageToUnlink, **kwargs):
"""Initialize a UnlinkBot instance with the given page to unlink."""
super(UnlinkBot, self).__init__(**kwargs)
@@ -50,6 +45,11 @@
self.generator = pageToUnlink.getReferences(
namespaces=self.getOption('namespaces'), content=True)
+ @property
+ def summary_parameters(self):
+ """Return the title parameter."""
+ return {'title': self.pageToUnlink.title()}
+
def treat_page(self):
"""Remove links pointing to the configured page from the given page."""
self.unlink(self.pageToUnlink)
--
To view, visit https://gerrit.wikimedia.org/r/487648
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: If60f27f06d3311e6830cfbb2a3b12d2631022c08
Gerrit-Change-Number: 487648
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/487657 )
Change subject: [tests] Test for UnknownExtension if 'Linter' is not available
......................................................................
[tests] Test for UnknownExtension if 'Linter' is not available
test for UnknownExtension if 'Linter' extension is not available
for a given site inside TestFactoryGenerator.test_linter_generator_show()
test method.
Bug: T215124
Change-Id: I92d3c4b013639948df6af04da50f2beaa6d0fbcf
---
M tests/pagegenerators_tests.py
1 file changed, 6 insertions(+), 3 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index 72f4673..a32debf 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -1220,9 +1220,12 @@
def test_linter_generator_show(self):
"""Test generator of pages with lint errors."""
gf = pagegenerators.GeneratorFactory(site=self.site)
- with self.assertRaises(SystemExit) as cm:
- gf.handleArg('-linter:show')
- self.assertEqual(cm.exception.code, 0)
+ if self.site.has_extension('Linter'):
+ with self.assertRaises(SystemExit) as cm:
+ gf.handleArg('-linter:show')
+ self.assertEqual(cm.exception.code, 0)
+ else:
+ self.assertRaises(UnknownExtension, gf.handleArg, '-linter:show')
def test_querypage_generator_with_valid_page(self):
"""Test generator of pages with lint errors."""
--
To view, visit https://gerrit.wikimedia.org/r/487657
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: I92d3c4b013639948df6af04da50f2beaa6d0fbcf
Gerrit-Change-Number: 487657
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/487630 )
Change subject: pagegenerators.py: fix tests in PY2 for -querypage
......................................................................
pagegenerators.py: fix tests in PY2 for -querypage
Bug: T214234
Change-Id: I0f09ff13c760e506081521e9dfacb20a5adeb9f3
---
M pywikibot/pagegenerators.py
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index d735c1f..f342683 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -59,6 +59,9 @@
if sys.version_info[0] > 2:
basestring = (str, )
+ from itertools import zip_longest
+else:
+ from itertools import izip_longest as zip_longest
_logger = 'pagegenerators'
@@ -754,8 +757,7 @@
max_w = max(len(p) for p in pages[::2]) + 4
txt = 'Available special pages:\n'
- for a, b in itertools.zip_longest(pages[::2], pages[1::2],
- fillvalue=''):
+ for a, b in zip_longest(pages[::2], pages[1::2], fillvalue=''):
txt += ' {a:<{max_w}}{b}\n'.format(a=a, b=b, max_w=max_w)
txt += ('\nMaximum number of pages to return is {max} '
'({highmax} for bots).\n'.format(**limit))
--
To view, visit https://gerrit.wikimedia.org/r/487630
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: I0f09ff13c760e506081521e9dfacb20a5adeb9f3
Gerrit-Change-Number: 487630
Gerrit-PatchSet: 1
Gerrit-Owner: Mpaa <mpaa.wiki(a)gmail.com>
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/487582 )
Change subject: [IMPR] Minor improvements of lonelypages.py script
......................................................................
[IMPR] Minor improvements of lonelypages.py script
1. Fixed typos in code
2. Removed params xml, page, limit from documentation because they are
already included by pagegenerators
Bug: T201491
Bug: T215102
Change-Id: I43dae94fe6a84ee35daa957f536b735863f926f1
---
M scripts/lonelypages.py
1 file changed, 2 insertions(+), 12 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/lonelypages.py b/scripts/lonelypages.py
index e46b311..df30892 100755
--- a/scripts/lonelypages.py
+++ b/scripts/lonelypages.py
@@ -7,14 +7,6 @@
¶ms;
--xml Retrieve information from a local XML dump (pages-articles
- or pages-meta-current, see https://dumps.wikimedia.org).
- Argument can also be given as "-xml:filename".
-
--page Only edit a specific page.
- Argument can also be given as "-page:pagetitle". You can
- give this parameter multiple times to edit multiple pages.
-
Furthermore, the following command line parameters are supported:
-enable: Enable or disable the bot via a Wiki Page.
@@ -22,8 +14,6 @@
-disambig: Set a page where the bot saves the name of the disambig
pages found (default: skip the pages)
--limit: Set how many pages check.
-
-always Always say yes, won't ask
@@ -143,7 +133,7 @@
try:
self.disambigtext = self.disambigpage.get()
except pywikibot.NoPage:
- pywikibot.output("{0} doesn't esist, skip!"
+ pywikibot.output("{0} doesn't exist, skip!"
.format(self.disambigpage.title()))
self.disambigtext = ''
except pywikibot.IsRedirectPage:
@@ -164,7 +154,7 @@
getenable = enable.get()
except pywikibot.NoPage:
pywikibot.output(
- "{0} doesn't esist, I use the page as if it was blank!"
+ "{0} doesn't exist, I use the page as if it was blank!"
.format(enable.title()))
getenable = ''
except pywikibot.IsRedirectPage:
--
To view, visit https://gerrit.wikimedia.org/r/487582
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: I43dae94fe6a84ee35daa957f536b735863f926f1
Gerrit-Change-Number: 487582
Gerrit-PatchSet: 5
Gerrit-Owner: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)