jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/735987 )
Change subject: [cleanup] Deprecate boolean watch parameter in Page.save()
......................................................................
[cleanup] Deprecate boolean watch parameter in Page.save()
Change-Id: I3d00cbcdf8410ff90768238df50222eeb2f7fb3c
---
M pywikibot/page/__init__.py
1 file changed, 16 insertions(+), 13 deletions(-)
Approvals:
JJMC89: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index 59d5781..f70199f 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -1132,16 +1132,21 @@
def save(self,
summary: Optional[str] = None,
- watch: Union[str, bool, None] = None,
+ watch: Optional[str] = None,
minor: bool = True,
botflag: Optional[bool] = None,
force: bool = False,
asynchronous: bool = False,
- callback=None, apply_cosmetic_changes=None,
- quiet: bool = False, **kwargs):
+ callback=None,
+ apply_cosmetic_changes: Optional[bool] = None,
+ quiet: bool = False,
+ **kwargs):
"""
Save the current contents of page's text to the wiki.
+ .. versionchanged:: 7.0
+ boolean watch parameter is deprecated
+
:param summary: The edit summary for the modification (optional, but
most wikis strongly encourage its use)
:param watch: Specify how the watchlist is affected by this edit, set
@@ -1151,11 +1156,6 @@
* preferences: use the preference settings (Default)
* nochange: don't change the watchlist
If None (default), follow bot account's default settings
-
- For backward compatibility watch parameter may also be boolean:
- if True, add or if False, remove this Page to/from bot
- user's watchlist.
- :type watch: str, bool (deprecated) or None
:param minor: if True, mark this edit as minor
:param botflag: if True, mark this edit as made by a bot (default:
True if user has bot status, False if not)
@@ -1170,7 +1170,6 @@
successful.
:param apply_cosmetic_changes: Overwrites the cosmetic_changes
configuration value to this value unless it's None.
- :type apply_cosmetic_changes: bool or None
:param quiet: enable/disable successful save operation message;
defaults to False.
In asynchronous mode, if True, it is up to the calling bot to
@@ -1178,10 +1177,14 @@
"""
if not summary:
summary = config.default_edit_summary
- if watch is True:
- watch = 'watch'
- elif watch is False:
- watch = 'unwatch'
+
+ if isinstance(watch, bool):
+ issue_deprecation_warning(
+ 'boolean watch parameter',
+ '"watch", "unwatch", "preferences" or "nochange" value',
+ since='7.0.0')
+ watch = ('unwatch', 'watch')[watch]
+
if not force and not self.botMayEdit():
raise OtherPageSaveError(
self, 'Editing restricted by {{bots}}, {{nobots}} '
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/735987
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: I3d00cbcdf8410ff90768238df50222eeb2f7fb3c
Gerrit-Change-Number: 735987
Gerrit-PatchSet: 1
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/+/736824 )
Change subject: [IMPR] Show an empty string if a environment variable is empty
......................................................................
[IMPR] Show an empty string if a environment variable is empty
If a environment variable is empty, nothing is printed. Now show an
empty string delimited by quotes if a environment variable is empty.
Also use repr() for family names instead of double quotes.
Change-Id: Ie044d8e58418ce7e4c756d4b7935b33e8d0d6f80
---
M scripts/version.py
1 file changed, 4 insertions(+), 4 deletions(-)
Approvals:
JJMC89: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/version.py b/scripts/version.py
index e4fa31a..9a2cf3d 100755
--- a/scripts/version.py
+++ b/scripts/version.py
@@ -85,15 +85,15 @@
settings.update(['PYWIKIBOT_DIR', 'PYWIKIBOT_DIR_PWB',
'PYWIKIBOT_NO_USER_CONFIG'])
for environ_name in sorted(settings):
- pywikibot.output('{}: {}'.format(environ_name,
- os.environ.get(environ_name,
- 'Not set')))
+ pywikibot.output(
+ '{}: {}'.format(environ_name,
+ os.environ.get(environ_name, 'Not set') or "''"))
pywikibot.output('Config base dir: ' + pywikibot.config.base_dir)
for family, usernames in pywikibot.config.usernames.items():
if not usernames:
continue
- pywikibot.output('Usernames for family "{}":'.format(family))
+ pywikibot.output('Usernames for family {!r}:'.format(family))
for lang, username in usernames.items():
pywikibot.output('\t{}: {}'.format(lang, username))
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/736824
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: Ie044d8e58418ce7e4c756d4b7935b33e8d0d6f80
Gerrit-Change-Number: 736824
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/+/736464 )
Change subject: [bugfix]: Upload: Only set filekey/offset for files with names
......................................................................
[bugfix]: Upload: Only set filekey/offset for files with names
When copy-uploading, the filekey and offset should not be set, as
this applies only when there is a filename, but during a copy-upload,
there is only a URL.
Bug: T294916
Change-Id: I38d0915ca46f2e144522e4c63961b3dc09a1943f
---
M pywikibot/site/_apisite.py
1 file changed, 19 insertions(+), 10 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index 4d11d71..8a7854f 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -2863,26 +2863,35 @@
if result['result'] == 'Warning':
assert 'warnings' in result and not ignore_all_warnings
- if 'filekey' in result:
- _file_key = result['filekey']
- elif 'sessionkey' in result:
- # TODO: Probably needs to be reflected in the API call
- # above
- _file_key = result['sessionkey']
- pywikibot.warning('Using sessionkey instead of filekey.')
+
+ if source_filename:
+ if 'filekey' in result:
+ _file_key = result['filekey']
+ elif 'sessionkey' in result:
+ # TODO: Probably needs to be reflected in the API call
+ # above
+ _file_key = result['sessionkey']
+ pywikibot.warning(
+ 'Using sessionkey instead of filekey.')
+ else:
+ _file_key = None
+ pywikibot.warning('No filekey defined.')
else:
_file_key = None
- pywikibot.warning('No filekey defined.')
if not report_success:
- result.setdefault('offset', True)
+ if source_filename:
+ offset = result.setdefault('offset', True)
+ else:
+ offset = False
+
if ignore_warnings(create_warnings_list(result)):
return self.upload(
filepage, source_filename=source_filename,
source_url=source_url, comment=comment,
text=text, watch=watch, ignore_warnings=True,
chunk_size=chunk_size, asynchronous=asynchronous,
- _file_key=_file_key, _offset=result['offset'],
+ _file_key=_file_key, _offset=offset,
report_success=False)
return False
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/736464
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: I38d0915ca46f2e144522e4c63961b3dc09a1943f
Gerrit-Change-Number: 736464
Gerrit-PatchSet: 3
Gerrit-Owner: Inductiveload <inductiveload(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/+/736181 )
Change subject: [doc] update ROADMAP.rst and CHANGELOG.md
......................................................................
[doc] update ROADMAP.rst and CHANGELOG.md
Change-Id: Iecaaa4391ef3fd6eb94e398517802e173f9699f6
---
M ROADMAP.rst
M scripts/CHANGELOG.md
2 files changed, 14 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 0b525c1..817a239 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -4,6 +4,8 @@
Improvements and Bugfixes
-------------------------
+* Update invisible characters from unicodedata 14.0.0
+* Make site parameter of textlib.replace_links() mandatory (T294649)
* Raise a generic ServerError if the http status code is unofficial (T293208)
* Add support for Wikimedia OCR engine with proofreadpage
* Rewrite tools.intersect_generators which makes it running up to 10'000 times faster. (T85623, T293276)
@@ -22,6 +24,13 @@
Code cleanups
-------------
+* Remove deprecated BaseSite namespace shortcuts
+* Remove deprecated Family.get_cr_templates method in favour of Site.category_redirects()
+* Remove deprecated Page.put_async() method (T193494)
+* Ignore baserevid parameter for several DataSite methods
+* Remove deprecated preloaditempages method
+* Remove disable_ssl_certificate_validation kwargs in http functions in favour of verify parameter (T265206)
+* Deprecated PYWIKIBOT2 environment variables were removed
* version.ParseError was removed in favour of exceptions.VersionParseError
* specialbots.EditReplacement and specialbots.EditReplacementError were removed in favour of exceptions.EditReplacementError
* site.PageInUse exception was removed in favour of exceptions.PageInUseError
@@ -57,9 +66,9 @@
Deprecations
^^^^^^^^^^^^
+* 7.0.0: baserevid parameter of editSource(), editQualifier(), removeClaims(), removeSources(), remove_qualifiers() DataSite methods will be removed
* 7.0.0: Values of APISite.allpages() parameter filterredir other than True, False and None are deprecated
* 6.5.0: OutputOption.output() method will be removed in favour of OutputOption.out property
* 6.4.0: Pywikibot `began using semantic versioning
<https://www.mediawiki.org/wiki/Manual:Pywikibot/Development/Guidelines#Depr…>`_,
all deprecated code will be removed in Pywikibot version 7.0.0.
-* 5.0.0: Methods deprecated for 5 years or longer will be removed
diff --git a/scripts/CHANGELOG.md b/scripts/CHANGELOG.md
index 138d75d..b87f57f 100644
--- a/scripts/CHANGELOG.md
+++ b/scripts/CHANGELOG.md
@@ -23,6 +23,9 @@
### commonscat
* Ignore InvalidTitleError in CommonscatBot.findCommonscatLink (T291783)
+### cosmetic_changes
+* Ignore InvalidTitleError in CosmeticChangesBot.treat_page (T293612)
+
### djvutext
* pass site arg only once (T292367)
@@ -88,7 +91,7 @@
* Enable multiple sites (T57083)
* Use new textlib.add_text function
-### cosmetic_changeds
+### cosmetic_changes
* set -ignore option to CANCEL.MATCH by default (T108446)
### fixing_redirects
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/736181
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: Iecaaa4391ef3fd6eb94e398517802e173f9699f6
Gerrit-Change-Number: 736181
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged