jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697170 )
Change subject: [doc] Additional glossary entries
......................................................................
[doc] Additional glossary entries
Change-Id: Ie5a58ddf170662d3f402bae314c285573895856b
---
M docs/glossary.rst
1 file changed, 18 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/docs/glossary.rst b/docs/glossary.rst
index 1adafff..49a49e8 100644
--- a/docs/glossary.rst
+++ b/docs/glossary.rst
@@ -33,7 +33,13 @@
- short for Pywikibot
- the :mod:`pwb` wrapper script
-
+
+ python2
+ A :term:`tag` for the last Pywikibot release `3.0.20200703`
+ supporting Python 2 (Python 2.7.3 - 2.7.18). Ask for `Python 2 to
+ 3 support <https://phabricator.wikimedia.org/T242120>`_ to
+ convert your old scripts.
+
pywikibot
**Py**\ thon Media\ **Wiki Bot** Framework, a Python library and
collection of scripts that automate work on MediaWiki sites.
@@ -49,6 +55,10 @@
after tests passes. This branch is preinstalled at :term:`PAWS`
and should be used for production systems.
+ tag
+ A marker of particular revisions (e.g. a release version). Each
+ Pywikibot release is tagged with its release version number.
+
trunk
A former name of :term:`compat`.
@@ -58,4 +68,10 @@
preinstalled the :term:`stable` release of Pywikibot. Refer:
- https://wikitech.wikimedia.org/wiki/PAWS
- - https://www.mediawiki.org/wiki/Manual:Pywikibot/PAWS
\ No newline at end of file
+ - https://www.mediawiki.org/wiki/Manual:Pywikibot/PAWS
+
+ PyPI
+ The Python Package Index (PyPI), a repository of software for the
+ Python programming language. Pywikibot framework (without scripts)
+ is `published monthly at PyPI
+ <https://pypi.org/project/pywikibot/>`_.
\ No newline at end of file
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697170
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ie5a58ddf170662d3f402bae314c285573895856b
Gerrit-Change-Number: 697170
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697401 )
Change subject: [doc] Update ROADMAP.rst
......................................................................
[doc] Update ROADMAP.rst
Change-Id: I84b254b3ff8c746b797f166055b074bcc71a3e92
---
M ROADMAP.rst
M pywikibot/cosmetic_changes.py
2 files changed, 7 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ROADMAP.rst b/ROADMAP.rst
index b242ebb..2a9fdcb 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -1,6 +1,11 @@
Current release changes
^^^^^^^^^^^^^^^^^^^^^^^
+* Check bot/nobots templates for cosmetic_changes hook (T283989)
+* Remove outdated opt._option which is already dropped (T284005)
+* Use IntEnum with cosmetic_changes CANCEL
+* Remove lru_cahce from botMayEdit method and fix it's logic (T283957)
+* DataSite.createNewItemFromPage() method was removed in favour of ImagePage.fromPage() (T98663)
* mwparserfromhell or wikitextparser MediaWiki markup parser is mandatory (T106763)
Deprecations
@@ -17,5 +22,4 @@
* 6.1.0: textlib.unescape() function will be removed in favour of html.unescape()
* 6.0.1: Site.undeletepage() and Site.undelete_file_versions() will be removed in favour of Site.undelete() method
* 6.0.1: Site.deletepage() and Site.deleteoldimage() will be removed in favour of Site.delete() method
-* 6.0.1: DataSite.createNewItemFromPage() method will be removed in favour of ImagePage.fromPage() (T98663)
* 5.0.0: Methods deprecated for 5 years or longer will be removed
diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index 8e60c34..3aaaf52 100755
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -183,6 +183,8 @@
If an error occurred and either skips the page or the method
or a single match. ALL raises the exception.
+
+ *New in version 6.3.*
"""
ALL = 0
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697401
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I84b254b3ff8c746b797f166055b074bcc71a3e92
Gerrit-Change-Number: 697401
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697178 )
Change subject: [IMPR] check bot/nobots templates for cosmetic_changes
......................................................................
[IMPR] check bot/nobots templates for cosmetic_changes
Bug: T283989
Change-Id: Ie2f39115a4bbcbab43989718deff8f1aca020866
---
M pywikibot/page/__init__.py
1 file changed, 12 insertions(+), 3 deletions(-)
Approvals:
Matěj Suchánek: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index ccd8f41..9aa6a09 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -1038,8 +1038,12 @@
self._bot_may_edit = self._check_bot_may_edit()
return self._bot_may_edit
- def _check_bot_may_edit(self) -> bool:
- """A botMayEdit helper method."""
+ def _check_bot_may_edit(self, module: Optional[str] = None) -> bool:
+ """A botMayEdit helper method.
+
+ @param module: The module name to be restricted. Defaults to
+ pywikibot.calledModuleName().
+ """
if not hasattr(self, 'templatesWithParams'):
return True
@@ -1047,7 +1051,6 @@
return True
username = self.site.username()
- module = pywikibot.calledModuleName()
try:
templates = self.templatesWithParams()
except (NoPageError, IsRedirectPageError, SectionError):
@@ -1056,6 +1059,9 @@
# go through all templates and look for any restriction
restrictions = set(self.site.get_edit_restricted_templates())
+ if module is None:
+ module = pywikibot.calledModuleName()
+
# also add archive templates for non-archive bots
if module != 'archivebot':
restrictions.update(self.site.get_archived_page_templates())
@@ -1222,6 +1228,8 @@
if self.isTalkPage() or self.content_model != 'wikitext' or \
pywikibot.calledModuleName() in config.cosmetic_changes_deny_script:
return summary
+
+ # check if cosmetic_changes is enabled for this page
family = self.site.family.name
if config.cosmetic_changes_mylang_only:
cc = ((family == config.family and self.site.lang == config.mylang)
@@ -1231,6 +1239,7 @@
cc = True
cc = cc and self.site.lang not in config.cosmetic_changes_disable.get(
family, [])
+ cc = cc and self._check_bot_may_edit('cosmetic_changes')
if not cc:
return summary
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697178
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ie2f39115a4bbcbab43989718deff8f1aca020866
Gerrit-Change-Number: 697178
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697400 )
Change subject: [bugfix] Remove outdated opt._option which is already dropped
......................................................................
[bugfix] Remove outdated opt._option which is already dropped
Bug: T284005
Change-Id: I38d9a96f63ea5c08bc5d086a1e8d43f326313780
---
M pywikibot/bot.py
1 file changed, 3 insertions(+), 5 deletions(-)
Approvals:
JJMC89: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 118823a..216b39d 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -1136,11 +1136,9 @@
# self.opt contains all available options including defaults
self.opt = _OptionDict(self.__class__.__name__, self.available_options)
- # self.options contains the options overridden from defaults
- self.opt._options = {opt: options[opt]
- for opt in received_options & valid_options}
- self.opt.update(self.opt._options)
-
+ # update the options overridden from defaults
+ self.opt.update((opt, options[opt])
+ for opt in received_options & valid_options)
for opt in received_options - valid_options:
pywikibot.warning('{} is not a valid option. It was ignored.'
.format(opt))
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697400
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I38d9a96f63ea5c08bc5d086a1e8d43f326313780
Gerrit-Change-Number: 697400
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697109 )
Change subject: [bugfix] Fix botMayEdit logic
......................................................................
[bugfix] Fix botMayEdit logic
The warning was printed when there was a valid key but the value didn't match any skip condition.
Also, store calledModuleName() in a variable to save space (and a little time).
Change-Id: Ibfce75f9157dae8fb94255e109b222e82323ed04
---
M pywikibot/page/__init__.py
1 file changed, 16 insertions(+), 18 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index c6048e8..ccd8f41 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -1047,6 +1047,7 @@
return True
username = self.site.username()
+ module = pywikibot.calledModuleName()
try:
templates = self.templatesWithParams()
except (NoPageError, IsRedirectPageError, SectionError):
@@ -1056,7 +1057,7 @@
restrictions = set(self.site.get_edit_restricted_templates())
# also add archive templates for non-archive bots
- if pywikibot.calledModuleName() != 'archivebot':
+ if module != 'archivebot':
restrictions.update(self.site.get_archived_page_templates())
# multiple bots/nobots templates are allowed
@@ -1095,9 +1096,7 @@
'Edit declined' % key)
return False
- if 'all' in names \
- or pywikibot.calledModuleName() in names \
- or username in names:
+ if 'all' in names or module in names or username in names:
return False
if title == 'Bots':
@@ -1111,24 +1110,23 @@
'{{bots|%s=}} is not valid. Ignoring.' % key)
continue
- if key == 'allow' and not ('all' in names
- or username in names):
- return False
+ if key == 'allow':
+ if not ('all' in names or username in names):
+ return False
- if key == 'deny' and ('all' in names or username in names):
- return False
+ elif key == 'deny':
+ if 'all' in names or username in names:
+ return False
- if key == 'allowscript' \
- and not ('all' in names
- or pywikibot.calledModuleName() in names):
- return False
+ elif key == 'allowscript':
+ if not ('all' in names or module in names):
+ return False
- if key == 'denyscript' \
- and ('all' in names
- or pywikibot.calledModuleName() in names):
- return False
+ elif key == 'denyscript':
+ if 'all' in names or module in names:
+ return False
- if key: # ignore unrecognized keys with a warning
+ elif key: # ignore unrecognized keys with a warning
pywikibot.warning(
'{{bots|%s}} is not valid. Ignoring.' % params[0])
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697109
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ibfce75f9157dae8fb94255e109b222e82323ed04
Gerrit-Change-Number: 697109
Gerrit-PatchSet: 3
Gerrit-Owner: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697138 )
Change subject: [bugfix] remove lru_cache from botMayEdit method
......................................................................
[bugfix] remove lru_cache from botMayEdit method
- lru_cache keeps all page references and leads to exhausting memory
usage if a lot of pages are loaded.
See also https://bugs.python.org/issue19859
Replace lru_cache by the Page attribute "_bot_may_edit"
- delete this cache attribute if a page is reloaded with Page.get(force)
from life wiki because the content can have been changed
Bug: T283957
Change-Id: Ia491a9e70203634e722caaa8e50a7388057376aa
---
M pywikibot/page/__init__.py
1 file changed, 9 insertions(+), 2 deletions(-)
Approvals:
Zhuyifei1999: Looks good to me, but someone else must approve
Rubin: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index dc4542d..c6048e8 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -30,7 +30,7 @@
import pywikibot
from pywikibot import config, i18n, textlib
-from pywikibot.backports import Dict, Iterable, List, Tuple, cache
+from pywikibot.backports import Dict, Iterable, List, Tuple
from pywikibot.comms import http
from pywikibot.exceptions import (
APIError,
@@ -440,6 +440,8 @@
"""
if force:
del self.latest_revision_id
+ if hasattr(self, '_bot_may_edit'):
+ del self._bot_may_edit
try:
self._getInternals()
except IsRedirectPageError:
@@ -1017,7 +1019,6 @@
"""DEPRECATED. Determine whether the page may be edited."""
return self.has_permission()
- @cache
def botMayEdit(self) -> bool:
"""
Determine whether the active bot is allowed to edit the page.
@@ -1033,6 +1034,12 @@
to override this by setting ignore_bot_templates=True in
user-config.py, or using page.put(force=True).
"""
+ if not hasattr(self, '_bot_may_edit'):
+ self._bot_may_edit = self._check_bot_may_edit()
+ return self._bot_may_edit
+
+ def _check_bot_may_edit(self) -> bool:
+ """A botMayEdit helper method."""
if not hasattr(self, 'templatesWithParams'):
return True
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697138
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ia491a9e70203634e722caaa8e50a7388057376aa
Gerrit-Change-Number: 697138
Gerrit-PatchSet: 4
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Rubin <rubin.happy(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/695548 )
Change subject: [IMPR] Refactor and test add_text argument parsing
......................................................................
[IMPR] Refactor and test add_text argument parsing
Splitting add_text's argument parsing into its own method with test coverage.
This is a pattern I loved within tor [1], and if approved I'll do the same for
other scripts as I go along.
The only functional changes to add_text are...
* Rearranged -help arguments by prominence. Either -text or -textfile are
mandatory so placing them first.
* The '-newimages' argument was unimplemented. Removed it from our help.
* Unrecognized arguments are now rejected rather than ignored.
* Error if both -text and -textfile are used rather than ignoring the later.
[1] https://gitweb.torproject.org/stem.git/tree/stem/interpreter/arguments.py
Change-Id: I6b4ca274278c8a4488a1a82ec063181d668d4c36
---
M scripts/add_text.py
M tests/add_text_tests.py
2 files changed, 176 insertions(+), 68 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/add_text.py b/scripts/add_text.py
index 1cfa980..b790d50 100755
--- a/scripts/add_text.py
+++ b/scripts/add_text.py
@@ -10,24 +10,22 @@
Furthermore, the following command line parameters are supported:
--talkpage Put the text onto the talk page instead
--talk
-
-text Define what text to add. "\n" are interpreted as newlines.
-textfile Define a texfile name which contains the text to add
-summary Define the summary to use
--excepturl Use the html page as text where you want to see if there's
- the text, not the wiki-page.
-
--newimages Add text in the new images
+-up If used, put the text at the top of the page
-always If used, the bot won't ask if it should add the specified
text
--up If used, put the text at the top of the page
+-talkpage Put the text onto the talk page instead
+-talk
+
+-excepturl Use the html page as text where you want to see if there's
+ the text, not the wiki-page.
-noreorder Avoid reordering cats and interwiki
@@ -57,6 +55,7 @@
# Distributed under the terms of the MIT license.
#
import codecs
+import collections
import re
import sys
from typing import Optional, Union
@@ -78,6 +77,24 @@
from pywikibot.tools import issue_deprecation_warning
from pywikibot.tools.formatter import color_format
+DEFAULT_ARGS = {
+ 'text': None,
+ 'text_file': None,
+ 'summary': None,
+ 'up': False,
+ 'always': False,
+ 'talk_page': False,
+ 'reorder': True,
+ 'regex_skip_url': None,
+}
+
+ARG_PROMPT = {
+ '-text': 'What text do you want to add?',
+ '-textfile': 'Which text file do you want to append to the page?',
+ '-summary': 'What summary do you want to use?',
+ '-excepturl': 'What url pattern should we skip?',
+}
+
docuReplacements = {'¶ms;': pagegenerators.parameterHelp} # noqa: N816
@@ -274,76 +291,99 @@
error_count += 1
-def main(*args: Tuple[str, ...]) -> None:
+def main(*argv: Tuple[str, ...]) -> None:
"""
Process command line arguments and invoke bot.
If args is an empty list, sys.argv is used.
- @param args: Command line arguments
+ @param argv: Command line arguments
"""
- # If none, the var is set only for check purpose.
- summary = None
- addText = None
- regexSkipUrl = None
- always = False
- textfile = None
- talkPage = False
- reorderEnabled = True
+ generator_factory = pagegenerators.GeneratorFactory()
- # Put the text above or below the text?
- up = False
-
- # Process global args and prepare generator args parser
- local_args = pywikibot.handle_args(args)
- genFactory = pagegenerators.GeneratorFactory()
-
- # Loading the arguments
- for arg in local_args:
- option, sep, value = arg.partition(':')
- if option == '-textfile':
- textfile = value or pywikibot.input(
- 'Which textfile do you want to add?')
- elif option == '-text':
- addText = value or pywikibot.input('What text do you want to add?')
- elif option == '-summary':
- summary = value or pywikibot.input(
- 'What summary do you want to use?')
- elif option == '-excepturl':
- regexSkipUrl = value or pywikibot.input('What text should I skip?')
- elif option == '-except':
- new_arg = ''.join(['-grepnot', sep, value])
- issue_deprecation_warning(arg, new_arg,
- 2, ArgumentDeprecationWarning,
- since='20201224')
- genFactory.handle_arg(new_arg)
- elif option == '-up':
- up = True
- elif option == '-noreorder':
- reorderEnabled = False
- elif option == '-always':
- always = True
- elif option in ('-talk', '-talkpage'):
- talkPage = True
- else:
- genFactory.handle_arg(arg)
-
- if textfile and not addText:
- with codecs.open(textfile, 'r', config.textfile_encoding) as f:
- addText = f.read()
-
- generator = genFactory.getCombinedGenerator()
- additional_text = '' if addText else "The text to add wasn't given."
- if pywikibot.bot.suggest_help(missing_generator=not generator,
- additional_text=additional_text):
+ try:
+ args = parse(argv, generator_factory)
+ except ValueError as exc:
+ pywikibot.bot.suggest_help(additional_text=str(exc))
return
- if talkPage:
+ text = args.text
+
+ if args.text_file:
+ with codecs.open(args.text_file, 'r', config.textfile_encoding) as f:
+ text = f.read()
+
+ generator = generator_factory.getCombinedGenerator()
+
+ if pywikibot.bot.suggest_help(missing_generator=not generator):
+ return
+
+ if args.talk_page:
generator = pagegenerators.PageWithTalkPageGenerator(generator, True)
+
for page in generator:
- add_text(page, addText, summary,
- regexSkipUrl=regexSkipUrl, always=always, up=up,
- reorderEnabled=reorderEnabled, create=talkPage)
+ add_text(page, text, args.summary,
+ regexSkipUrl=args.regex_skip_url, always=args.always,
+ up=args.up, reorderEnabled=args.reorder,
+ create=args.talk_page)
+
+
+def parse(argv: Tuple[str, ...],
+ generator_factory: pagegenerators.GeneratorFactory
+ ) -> collections.namedtuple:
+ """
+ Parses our arguments and provide a named tuple with their values.
+
+ @param argv: input arguments to be parsed
+ @param generator_factory: factory that will determine the page to edit
+
+ @return: a namedtuple with our parsed arguments
+
+ @raise: ValueError if we receive invalid arguments
+ """
+ args = dict(DEFAULT_ARGS)
+ argv = pywikibot.handle_args(argv)
+ argv = generator_factory.handle_args(argv)
+
+ for arg in argv:
+ option, _, value = arg.partition(':')
+
+ if not value and option in ARG_PROMPT:
+ value = pywikibot.input(ARG_PROMPT[option])
+
+ if option == '-text':
+ args['text'] = value
+ elif option == '-textfile':
+ args['text_file'] = value
+ elif option == '-summary':
+ args['summary'] = value
+ elif option == '-up':
+ args['up'] = True
+ elif option == '-always':
+ args['always'] = True
+ elif option in ('-talk', '-talkpage'):
+ args['talk_page'] = True
+ elif option == '-noreorder':
+ args['reorder'] = False
+ elif option == '-except':
+ page_gen_arg = '-grepnot:{}'.format(value)
+ issue_deprecation_warning(arg, page_gen_arg,
+ 2, ArgumentDeprecationWarning,
+ since='20201224')
+ generator_factory.handle_arg(page_gen_arg)
+ elif option == '-excepturl':
+ args['regex_skip_url'] = value
+ else:
+ raise ValueError("Argument '{}' is unrecognized".format(option))
+
+ if not args['text'] and not args['text_file']:
+ raise ValueError("Either the '-text' or '-textfile' is required")
+
+ if args['text'] and args['text_file']:
+ raise ValueError("'-text' and '-textfile' cannot both be used")
+
+ Args = collections.namedtuple('Args', args.keys())
+ return Args(**args)
if __name__ == '__main__':
diff --git a/tests/add_text_tests.py b/tests/add_text_tests.py
index fca8331..30d987f 100644
--- a/tests/add_text_tests.py
+++ b/tests/add_text_tests.py
@@ -5,9 +5,14 @@
# Distributed under the terms of the MIT license.
#
import unittest
+from unittest.mock import Mock, patch
import pywikibot
-from scripts.add_text import add_text, get_text
+import pywikibot.pagegenerators
+
+from pywikibot.exceptions import ArgumentDeprecationWarning
+from pywikibot.tools import suppress_warnings
+from scripts.add_text import add_text, get_text, parse
from tests.aspects import TestCase
@@ -24,6 +29,69 @@
"""Setup test."""
super().setUp()
self.page = pywikibot.Page(self.site, 'foo')
+ self.generator_factory = pywikibot.pagegenerators.GeneratorFactory()
+
+ @patch('pywikibot.handle_args', Mock(side_effect=lambda args: args))
+ def test_parse(self):
+ """Basic argument parsing."""
+ args = parse(['-text:"hello world"'], self.generator_factory)
+ self.assertEqual('"hello world"', args.text)
+ self.assertFalse(args.up)
+ self.assertTrue(args.reorder)
+
+ args = parse(['-text:hello', '-up', '-noreorder'],
+ self.generator_factory)
+ self.assertEqual('hello', args.text)
+ self.assertTrue(args.up)
+ self.assertFalse(args.reorder)
+
+ @patch('pywikibot.handle_args', Mock(side_effect=lambda args: args))
+ def test_unrecognized_argument(self):
+ """Provide an argument that doesn't exist."""
+ expected_error = "Argument '-no_such_arg' is unrecognized"
+
+ for invalid_arg in ('-no_such_arg', '-no_such_arg:hello'):
+ with self.assertRaisesRegex(ValueError, expected_error):
+ parse([invalid_arg], self.generator_factory)
+
+ @patch('pywikibot.handle_args', Mock(side_effect=lambda args: args))
+ def test_neither_text_argument(self):
+ """Don't provide either -text or -textfile."""
+ expected_error = "Either the '-text' or '-textfile' is required"
+
+ with self.assertRaisesRegex(ValueError, expected_error):
+ parse(['-noreorder'], self.generator_factory)
+
+ @patch('pywikibot.handle_args', Mock(side_effect=lambda args: args))
+ def test_both_text_arguments(self):
+ """Provide both -text and -textfile."""
+ expected_error = "'-text' and '-textfile' cannot both be used"
+
+ with self.assertRaisesRegex(ValueError, expected_error):
+ parse(['-text:hello', '-textfile:/some/path'],
+ self.generator_factory)
+
+ @patch('pywikibot.handle_args', Mock(side_effect=lambda args: args))
+ def test_except_argument(self):
+ """Check the deprecated -except argument."""
+ generator_factory = Mock()
+ generator_factory.handle_args.side_effect = lambda args: args
+
+ with suppress_warnings('-except:stuff is deprecated',
+ ArgumentDeprecationWarning):
+ parse(['-text:hello', '-except:stuff'], generator_factory)
+
+ generator_factory.handle_arg.assert_called_with('-grepnot:stuff')
+
+ @patch('pywikibot.input')
+ @patch('pywikibot.handle_args', Mock(side_effect=lambda args: args))
+ def test_argument_prompt(self, input_mock):
+ """Reqest an argument that requres a prompt."""
+ input_mock.return_value = 'hello world'
+
+ args = parse(['-text'], self.generator_factory)
+ self.assertEqual('hello world', args.text)
+ input_mock.assert_called_with('What text do you want to add?')
def test_basic(self):
"""Test adding text."""
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/695548
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I6b4ca274278c8a4488a1a82ec063181d668d4c36
Gerrit-Change-Number: 695548
Gerrit-PatchSet: 4
Gerrit-Owner: Damian <atagar1(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/692884 )
Change subject: [IMPR] show a {black;yellow} bar on simulation
......................................................................
[IMPR] show a {black;yellow} bar on simulation
Use a yellow bar. Otherwise the message would interfer the
transliteration text (lightyellow on black)
Change-Id: I6716f9176d7c013335f5e5124c8508a1033d9f25
---
M pywikibot/data/api.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 733ef13..ab699fb 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -1330,7 +1330,7 @@
if action and config.simulate and (
self.write or action in config.actions_to_block):
pywikibot.output(color_format(
- '{lightyellow}SIMULATION: {0} action blocked.{default}',
+ '{black;yellow}SIMULATION: {} action blocked.{default}',
action))
# for more realistic simulation
if config.simulate is not True:
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/692884
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I6716f9176d7c013335f5e5124c8508a1033d9f25
Gerrit-Change-Number: 692884
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697074 )
Change subject: [IMPR] Remove MultipleSitesBot if subclassing is not necessary
......................................................................
[IMPR] Remove MultipleSitesBot if subclassing is not necessary
- MultipleSitesBot is just an alias for BaseBot and has no functionality.
Remove it if any other bot class is used already.
- Update documentation
Change-Id: I1ab88fd9009969bd8762f685d44748f564a57fea
---
M pywikibot/bot.py
M scripts/category.py
M scripts/cosmetic_changes.py
M scripts/delete.py
M scripts/movepages.py
M scripts/redirect.py
6 files changed, 14 insertions(+), 20 deletions(-)
Approvals:
JJMC89: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 3112344..6805d1d 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -5,7 +5,9 @@
conjunction. Each bot should subclass at least one of these four classes:
* L{BaseBot}: Basic bot class in case where the site is handled differently,
- like working on two sites in parallel.
+ like working on multiple sites in parallel. No site attribute is provided.
+ Instead site of the current page should be used. This class should
+ normally not be used directly.
* L{SingleSiteBot}: Bot class which should only be run on a single site. They
usually store site specific content and thus can't be easily run when the
@@ -13,10 +15,8 @@
can also be changed. If the generator returns a page of a different site
it'll skip that page.
-* L{MultipleSitesBot}: Bot class which supports to be run on multiple sites
- without the need to manually initialize it every time. It is not possible to
- set the C{site} property and it's deprecated to request it. Instead site of
- the current page should be used. And out of C{run} that sit isn't defined.
+* L{MultipleSitesBot}: An alias of L{BaseBot}. Should not be used if any
+ other bot class is used.
* L{ConfigParserBot}: Bot class which supports reading options from a
scripts.ini configuration file. That file consists of sections, led by a
diff --git a/scripts/category.py b/scripts/category.py
index 1fea6ec..246875c 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -134,7 +134,6 @@
Bot,
ContextOption,
IntegerOption,
- MultipleSitesBot,
StandardOption,
suggest_help,
)
@@ -403,7 +402,7 @@
.format(config.shortpath(filename)))
-class CategoryAddBot(MultipleSitesBot, CategoryPreprocess):
+class CategoryAddBot(CategoryPreprocess):
"""A robot to mass-add a category to a list of pages."""
diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py
index 40770ba..edb77c5 100755
--- a/scripts/cosmetic_changes.py
+++ b/scripts/cosmetic_changes.py
@@ -34,7 +34,7 @@
import pywikibot
from pywikibot import config, i18n, pagegenerators
from pywikibot.backports import Tuple
-from pywikibot.bot import ExistingPageBot, MultipleSitesBot, NoRedirectPageBot
+from pywikibot.bot import ExistingPageBot, NoRedirectPageBot
from pywikibot.cosmetic_changes import (
CANCEL_ALL,
CANCEL_MATCH,
@@ -56,7 +56,7 @@
}
-class CosmeticChangesBot(MultipleSitesBot, ExistingPageBot, NoRedirectPageBot):
+class CosmeticChangesBot(ExistingPageBot, NoRedirectPageBot):
"""Cosmetic changes bot."""
diff --git a/scripts/delete.py b/scripts/delete.py
index 739541a..459e3b1 100755
--- a/scripts/delete.py
+++ b/scripts/delete.py
@@ -60,7 +60,7 @@
import pywikibot
from pywikibot import i18n, pagegenerators
from pywikibot.backports import DefaultDict, Set, Tuple
-from pywikibot.bot import CurrentPageBot, MultipleSitesBot
+from pywikibot.bot import CurrentPageBot
from pywikibot.page import Page
from pywikibot.site import Namespace
from pywikibot.tools import islice_with_ellipsis
@@ -123,7 +123,7 @@
return set(namespaces) & set(self.ref_table)
-class DeletionRobot(MultipleSitesBot, CurrentPageBot):
+class DeletionRobot(CurrentPageBot):
"""This robot allows deletion of pages en masse."""
diff --git a/scripts/movepages.py b/scripts/movepages.py
index 7c4523c..3ce2562 100755
--- a/scripts/movepages.py
+++ b/scripts/movepages.py
@@ -39,7 +39,7 @@
import pywikibot
from pywikibot import i18n, pagegenerators
-from pywikibot.bot import CurrentPageBot, MultipleSitesBot
+from pywikibot.bot import CurrentPageBot
from pywikibot.exceptions import PageRelatedError
@@ -48,7 +48,7 @@
docuReplacements = {'¶ms;': pagegenerators.parameterHelp} # noqa: N816
-class MovePagesBot(MultipleSitesBot, CurrentPageBot):
+class MovePagesBot(CurrentPageBot):
"""Page move bot."""
diff --git a/scripts/redirect.py b/scripts/redirect.py
index 599a983..02ace44 100755
--- a/scripts/redirect.py
+++ b/scripts/redirect.py
@@ -78,12 +78,7 @@
import pywikibot.data
from pywikibot import i18n, pagegenerators, xmlreader
from pywikibot.backports import Dict, List, Set, Tuple
-from pywikibot.bot import (
- ExistingPageBot,
- MultipleSitesBot,
- OptionHandler,
- RedirectPageBot,
-)
+from pywikibot.bot import ExistingPageBot, OptionHandler, RedirectPageBot
from pywikibot.exceptions import (
CircularRedirectError,
InterwikiRedirectPageError,
@@ -378,7 +373,7 @@
continue
-class RedirectRobot(MultipleSitesBot, ExistingPageBot, RedirectPageBot):
+class RedirectRobot(ExistingPageBot, RedirectPageBot):
"""Redirect bot."""
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697074
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I1ab88fd9009969bd8762f685d44748f564a57fea
Gerrit-Change-Number: 697074
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/680301 )
Change subject: [parser] Make mwparserfromhell or wikitextparser mandatory
......................................................................
[parser] Make mwparserfromhell or wikitextparser mandatory
- check whether mwparserfromhell or wikitextparser is installed and
raise ImportError if no package is available
- update tox.ini
- update some documentation hints
Bug: T106763
Change-Id: Ie89d08074a9d9b6380a0276fac261b8f6a55156f
---
M ROADMAP.rst
M pywikibot/textlib.py
M tests/__init__.py
M tox.ini
4 files changed, 20 insertions(+), 60 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 36e8705..b242ebb 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -1,7 +1,7 @@
Current release changes
^^^^^^^^^^^^^^^^^^^^^^^
-* (No changes yet)
+* mwparserfromhell or wikitextparser MediaWiki markup parser is mandatory (T106763)
Deprecations
^^^^^^^^^^^^
@@ -14,7 +14,6 @@
* 6.2.0: empty_iterator will be removed in favour of iter()
* 6.1.0: tools.frozenmap will be removed in favour of types.MappingProxyType
* 6.1.0: tools.DotReadableDict will be removed
-* 6.1.0: mwparserfromhell or wikitextparser MediaWiki markup parser becomes mandatory (T106763)
* 6.1.0: textlib.unescape() function will be removed in favour of html.unescape()
* 6.0.1: Site.undeletepage() and Site.undelete_file_versions() will be removed in favour of Site.undelete() method
* 6.0.1: Site.deletepage() and Site.deleteoldimage() will be removed in favour of Site.delete() method
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 2b14c97..696c6c3 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -37,8 +37,18 @@
except ImportError:
try:
import mwparserfromhell as wikitextparser
- except ImportError as e:
- wikitextparser = e
+ except ImportError:
+ # print required because pywikibot is not imported completely
+ raise ImportError("""
+Pywikibot is missing a MediaWiki markup parser which is necessary.
+Please update the required module with either
+
+ pip install "mwparserfromhell>=0.5.0"
+
+or
+
+ pip install "wikitextparser>=0.47.0"
+""") from None
ETPType = List[Tuple[str, OrderedDictType[str, str]]]
@@ -1585,16 +1595,11 @@
only the last value provided will be returned.
This uses the package L{mwparserfromhell} or L{wikitextparser} as
- MediaWiki markup parser. Otherwise it falls back on a regex based
- implementation but it becomes mandatory that one of them is
+ MediaWiki markup parser. It is mandatory that one of them is
installed.
There are minor differences between the two implementations.
- The two implementations return nested templates in a different
- order, i.e. for `{{a|b={{c}}}}`, parsers returns `[a, c]`, whereas
- regex returns `[c, a]`.
-
The parser packages preserves whitespace in parameter names and
values.
@@ -1613,45 +1618,6 @@
*New in version 6.1:* *wikitextparser* package is supported; either
*wikitextparser* or *mwparserfromhell* is strictly recommended.
"""
- use_regex = isinstance(wikitextparser, ImportError)
-
- if remove_disabled_parts:
- text = removeDisabledParts(text)
-
- if use_regex:
- issue_deprecation_warning("""
-Pywikibot needs a MediaWiki markup parser.
-Please install the requested module with either
-
- pip install "mwparserfromhell>=0.5.0"
-
-or
-
- pip install "wikitextparser>=0.47.0"
-
-Using pywikibot without MediaWiki markup parser""",
- warning_class=FutureWarning,
- since='20210416')
-
- return _extract_templates_and_params_regex(text, False, strip)
- return _extract_templates_and_params_parser(text, strip)
-
-
-def _extract_templates_and_params_parser(text: str,
- strip: bool = False) -> ETPType:
- """
- Extract templates with params using mwparserfromhell.
-
- This function should not be called directly.
-
- Use extract_templates_and_params, which will select this parser
- implementation if the mwparserfromhell or wikitextparser package is
- installed.
-
- @param text: The wikitext from which templates are extracted
- @param strip: if enabled, strip arguments and values of templates
- @return: list of template name and params
- """
def explicit(param):
try:
attr = param.showkey
@@ -1659,6 +1625,9 @@
attr = not param.positional
return attr
+ if remove_disabled_parts:
+ text = removeDisabledParts(text)
+
parser_name = wikitextparser.__name__
pywikibot.log('Using {!r} wikitext parser'.format(parser_name))
@@ -1701,7 +1670,7 @@
global wikitextparser
saved_parser = wikitextparser
import mwparserfromhell as wikitextparser
- result = _extract_templates_and_params_parser(text, strip)
+ result = extract_templates_and_params(text, strip=strip)
wikitextparser = saved_parser
return result
@@ -1723,14 +1692,6 @@
@param strip: if enabled, strip arguments and values of templates
@return: list of template name and params
"""
- return _extract_templates_and_params_regex(text, remove_disabled_parts,
- strip)
-
-
-def _extract_templates_and_params_regex(text: str,
- remove_disabled_parts: bool = True,
- strip: bool = True) -> ETPType:
- """DEPRECATED. Extract templates with params using a regex."""
# remove commented-out stuff etc.
if remove_disabled_parts:
thistxt = removeDisabledParts(text)
diff --git a/tests/__init__.py b/tests/__init__.py
index ebac252..ce88efe 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -23,7 +23,7 @@
# Verify that the unit tests have a base working environment:
# - requests is mandatory
# however if unavailable this will fail on use; see pywikibot/tools.py
-# - mwparserfromhell or wikitextparser should be used but the dependency
+# - mwparserfromhell or wikitextparser is mandatory but the dependency
# is checked by textlib already
import requests # noqa: F401
diff --git a/tox.ini b/tox.ini
index 7bf0112..98c63f2 100644
--- a/tox.ini
+++ b/tox.ini
@@ -38,10 +38,10 @@
fasttest: pytest-attrib>=0.1.3
fasttest: pytest-subtests >= 0.3.2
fasttest: mock
+ fasttest: .[mwparserfromhell]
fasttest: .[scripts]
fasttest-py35: .[html]
- fasttest-py35: .[mwparserfromhell]
fasttest-py37: .[wikitextparser]
deeptest: .[html]
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/680301
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ie89d08074a9d9b6380a0276fac261b8f6a55156f
Gerrit-Change-Number: 680301
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697061 )
Change subject: [cleanup] Require archivebot durations to have a time unit
......................................................................
[cleanup] Require archivebot durations to have a time unit
This reverts commit 4a350673c4aec0fefb1029f47698f7819430a35c.
Change-Id: I3dfa60dfa66022cdb1f573605d495078407703e1
---
M scripts/archivebot.py
M tests/archivebot_tests.py
2 files changed, 17 insertions(+), 15 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index f3c2370..03353a8 100755
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -116,7 +116,6 @@
findmarker,
to_local_digits,
)
-from pywikibot.tools import issue_deprecation_warning
ShouldArchive = Tuple[str, str]
@@ -242,15 +241,19 @@
@return: key and duration extracted form the string
"""
- if string.isdigit():
- key = 's'
- duration = string
- issue_deprecation_warning('Time period without qualifier',
- string + key, 1, FutureWarning,
- since='20161009')
- else:
- key = string[-1]
- duration = string[:-1]
+ if len(string) < 2:
+ raise MalformedConfigError('Time period should be a numeric value '
+ 'followed by its qualifier')
+
+ key, duration = string[-1], string[:-1]
+
+ if key not in MW_KEYS:
+ raise MalformedConfigError('Time period qualifier is unrecognized: {}'
+ .format(string))
+ if not duration.isdigit():
+ raise MalformedConfigError("Time period's duration should be "
+ 'numeric: {}'.format(string))
+
return key, duration
diff --git a/tests/archivebot_tests.py b/tests/archivebot_tests.py
index 9bf1e36..e3a3828 100644
--- a/tests/archivebot_tests.py
+++ b/tests/archivebot_tests.py
@@ -12,7 +12,6 @@
import pywikibot.page
from pywikibot.exceptions import Error
from pywikibot.textlib import TimeStripper
-from pywikibot.tools import suppress_warnings
from scripts import archivebot
from tests.aspects import TestCase
@@ -97,12 +96,12 @@
def test_checkstr(self):
"""Test for extracting key and duration from shorthand notation."""
self.assertEqual(archivebot.checkstr('400s'), ('s', '400'))
- with suppress_warnings('Time period without qualifier', UserWarning):
- self.assertEqual(archivebot.checkstr('3000'), ('s', '3000'))
self.assertEqual(archivebot.checkstr('7d'), ('d', '7'))
self.assertEqual(archivebot.checkstr('3y'), ('y', '3'))
- # Should pass, because the key is verified in str2time
- self.assertEqual(archivebot.checkstr('4000@'), ('@', '4000'))
+
+ for invalid_value in ('', '3000', '4000@'):
+ with self.assertRaises(archivebot.MalformedConfigError):
+ archivebot.checkstr(invalid_value)
def test_str2size(self):
"""Test for parsing the shorthand notation of sizes."""
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697061
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I3dfa60dfa66022cdb1f573605d495078407703e1
Gerrit-Change-Number: 697061
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Damian <atagar1(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697058 )
Change subject: [6.3] Prepare next release
......................................................................
[6.3] Prepare next release
Change-Id: I474c51d33f63f6009d58947490c1016cae16fd4e
---
M .appveyor.yml
M HISTORY.rst
M ROADMAP.rst
M pywikibot/__metadata__.py
4 files changed, 48 insertions(+), 41 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.appveyor.yml b/.appveyor.yml
index f8a57d6..534fc84 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -1,7 +1,7 @@
image: Visual Studio 2019
clone_depth: 50
skip_tags: true
-version: 6.2.{build}
+version: 6.3.{build}
environment:
PYWIKIBOT_DIR: "%appdata%\\Pywikibot"
diff --git a/HISTORY.rst b/HISTORY.rst
index 1c316df..8348776 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -1,6 +1,51 @@
Release history
^^^^^^^^^^^^^^^
+6.2.0
+-----
+*28 May 2021*
+
+Improvements and Bugfixes
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+* Use different logfiles for multiple processes of the same script (T56685)
+* throttle.pip will be reused as soon as possbile
+* terminal_interface_base.TerminalHandler is subclassed from logging.StreamHandler
+* Fix iterating of SizedKeyCollection (T282865)
+* An abstract base user interface module was added
+* APISite method pagelanglinks() may skip links with empty titles (T223157)
+* Fix Page.getDeletedRevision() method which always returned an empty list
+* Async chunked uploads are supported (T129216, T133443)
+* A new InvalidPageError will be raised if a Page has no version history (T280043)
+* L10N updates
+* Fix __getattr__ for WikibaseEntity (T281389)
+* Handle abusefilter-{disallow,warning} codes (T85656)
+
+Code cleanups
+~~~~~~~~~~~~~
+
+* MultipleSitesBot.site attribute was removed (T283209)
+* Deprecated BaseSite.category_namespaces() method was removed
+* i18n.twntranslate() function was removed in favour of twtranslate()
+* siteinfo must be used as a dictionary ad cannot be called anymore
+* APISite.has_transcluded_data() method was removed
+* Deprecated LogEntry.title() method was removed
+* Deprecated APISite.watchpage() method was removed
+* OptionHandler.options dict has been removed in favour of OptionHandler.opt
+* The toStdout parameter of ui.output has been dropped
+* terminal_interface_base.TerminalFormatter was removed
+* Move page functions UnicodeToAsciiHtml, unicode2html, url2unicode to tools.chars with renaming them
+* Rename _MultiTemplateMatchBuilder to MultiTemplateMatchBuilder
+* User.name() method was removed in favour of User.username property
+* BasePage.getLatestEditors() method was removed in favour of contributors() or revisions()
+* pagenenerators.handleArg() method was renamed to handle_arg() (T271437)
+* CategoryGenerator, FileGenerator, ImageGenerator and ReferringPageGenerator pagegenerator functions were removed
+* Family.ignore_certificate_error() method was removed in favour of verify_SSL_certificate (T265205)
+* tools.is_IP was renamed to is_ip_address due to PEP8
+* config2.py was renamed to config.py
+* Exceptions were renamed having a suffix "Error" due to PEP8 (T280227)
+
+
6.1.0
-----
*17 April 2021*
diff --git a/ROADMAP.rst b/ROADMAP.rst
index a4c4dc5..36e8705 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -1,45 +1,7 @@
Current release changes
^^^^^^^^^^^^^^^^^^^^^^^
-Improvements and Bugfixes
--------------------------
-
-* Use different logfiles for multiple processes of the same script (T56685)
-* throttle.pip will be reused as soon as possbile
-* terminal_interface_base.TerminalHandler is subclassed from logging.StreamHandler
-* Fix iterating of SizedKeyCollection (T282865)
-* An abstract base user interface module was added
-* APISite method pagelanglinks() may skip links with empty titles (T223157)
-* Fix Page.getDeletedRevision() method which always returned an empty list
-* Async chunked uploads are supported (T129216, T133443)
-* A new InvalidPageError will be raised if a Page has no version history (T280043)
-* L10N updates
-* Fix __getattr__ for WikibaseEntity (T281389)
-* Handle abusefilter-{disallow,warning} codes (T85656)
-
-Code cleanups
--------------
-
-* MultipleSitesBot.site attribute was removed (T283209)
-* Deprecated BaseSite.category_namespaces() method was removed
-* i18n.twntranslate() function was removed in favour of twtranslate()
-* siteinfo must be used as a dictionary ad cannot be called anymore
-* APISite.has_transcluded_data() method was removed
-* Deprecated LogEntry.title() method was removed
-* Deprecated APISite.watchpage() method was removed
-* OptionHandler.options dict has been removed in favour of OptionHandler.opt
-* The toStdout parameter of ui.output has been dropped
-* terminal_interface_base.TerminalFormatter was removed
-* Move page functions UnicodeToAsciiHtml, unicode2html, url2unicode to tools.chars with renaming them
-* Rename _MultiTemplateMatchBuilder to MultiTemplateMatchBuilder
-* User.name() method was removed in favour of User.username property
-* BasePage.getLatestEditors() method was removed in favour of contributors() or revisions()
-* pagenenerators.handleArg() method was renamed to handle_arg() (T271437)
-* CategoryGenerator, FileGenerator, ImageGenerator and ReferringPageGenerator pagegenerator functions were removed
-* Family.ignore_certificate_error() method was removed in favour of verify_SSL_certificate (T265205)
-* tools.is_IP was renamed to is_ip_address due to PEP8
-* config2.py was renamed to config.py
-* Exceptions were renamed having a suffix "Error" due to PEP8 (T280227)
+* (No changes yet)
Deprecations
^^^^^^^^^^^^
diff --git a/pywikibot/__metadata__.py b/pywikibot/__metadata__.py
index 02c154b..f035a4b 100644
--- a/pywikibot/__metadata__.py
+++ b/pywikibot/__metadata__.py
@@ -11,7 +11,7 @@
__name__ = 'pywikibot'
-__version__ = '6.2.0'
+__version__ = '6.3.0.dev0'
__description__ = 'Python MediaWiki Bot Framework'
__maintainer__ = 'The Pywikibot team'
__maintainer_email__ = 'pywikibot(a)lists.wikimedia.org'
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697058
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I474c51d33f63f6009d58947490c1016cae16fd4e
Gerrit-Change-Number: 697058
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged