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