Since some time the watch action supports a titles parameter and the title parameter has been deprecated.
Description
Details
| Subject | Author | Repo | Branch | Lines +/- | |
|---|---|---|---|---|---|
| site.py: Support titles parameter in watch action | Dalba | pywikibot/core | master | +45 -3 | |
| site.py:Support titles parameter in watch action | Dalba | pywikibot/core | master | +0 -0 |
Related Objects
Event Timeline
Change 261903 had a related patch set uploaded (by Dalba):
site.py:Support titles parameter in watch action
Change 261904 had a related patch set uploaded (by Dalba):
site.py:Support titles parameter in watch action
Change 261903 abandoned by Dalba:
site.py:Support titles parameter in watch action
Reason:
This one has been committed by mistake (don't know how).
As I mentioned on the code review, I would prefer that mw <1.23 supports multiple titles by iterating over the list of titles and watching each one. Thoughts on this?
During code review I noticed that watchpage was issuing an 'error' level logging message when the API result did not contain the expected data element watch. IMO this should be an exception (even an assertion), not a UI error message.
e.g. editpage does
assert "edit" in result and "result" in result["edit"], result
with only a UI error message, it is not possible for the caller to distinguish between malformed API response, and a failure to (un)watch only one page (e.g. s.watchpage('Foo|Special:Goo') returns False )
However if we introduced an assertion/exception here for 1.23+, we would need also change the <1.23 code to use an assertion/exception. That would be a slightly breaking change to existing behaviour; personally speaking, do not mind that breaking change if documented, as it is more sane behaviour for a very unlikely scenario, so very few people will experience the breakage.
However an alternative, which avoids a breaking change, is to create a new method 'watchpages' (i.e. plural) (or just 'watch'?) that uses exceptions/assertions, and deprecate the existing 'watchpage' method which does this UI error message.
Change 261904 merged by jenkins-bot:
site.py: Support titles parameter in watch action