Hi all,
a new stable release Pywikibot 7.2 has been deployed today.
What is new with this release?
Improvements:
- The logging system was rewritten. All parameters except of the first are keyword only parameter now, the usage of positional arguments is deprecated. pywikibot.info() is an alias for pywikibot.output to be compliant with the Python logging system. To write a newline you may use pywikibot.into() (or pywikibot.output()) without any msg parameter; the msg parameter can also be omitted with pywikibot.stdout(). The layer parameter is now optinal for pywikibot.debug. It also works with other logging functions. Refer [1] for additional informations.
- A new and easier color format was implemented; Instead of 'This is a\03{green}colored{default} text' you can write 'This is a <<green>>colored<<default>> text'.This makes colors in format string much easier like 'This is a <<{color}>>{color} colored<<default>> text'.format(color='green') which produces 'This is a green colored text' where 'geen colored' is printed in green. The tools.formatter.color_format() functions is deprecated now.
- Lexeme support for Lexicographical data was implemented.
- use BaseBot attributes use_redirect and use_disambigs to filter processing of redirects or disambigs Refer [2] for further information
Other changes:
All archived scripts were removed; create a Phabricator task to restore some
Deprecations:
- pagegenerators.XMLDumpOldPageGenerator has been deprecated. Use XMLDumpPageGenerator wit content=True instead
Bugfixes:
- Several bugfixes and other improvements were made with this release too. Refer the changelog [3] for the complete list of changes.
Announcements/RfC:
- Toolforge is going to have Python 3.7 and 3.9 available in May. I propose to drop Python 3.5 support after that with Pywikibot 8 because there are a lot of disadvantages and problems with this release. Refer [4] for this task
- a general theme is that the ApiResult arrays have a lot of metadata especially for Wikibase items. MediaWiki API has introduced a formatversion 2 which simplifies the data exchange a lot. Therefore MediaWiki support for 1.23 - 1.26 has to be dropped (with Pywikibot 8) [5]
Best
xqt
[1] https://doc.wikimedia.org/pywikibot/stable/api_ref/pywikibot.html?highlight=logging#module-pywikibot.logging
[2] https://doc.wikimedia.org/pywikibot/stable/api_ref/pywikibot.html?highlight=use_disambigs#pywikibot.bot.BaseBot.use_disambigs
[3] https://doc.wikimedia.org/pywikibot/stable/changelog.html
[4] https://phabricator.wikimedia.org/T301908
[5] https://phabricator.wikimedia.org/T306637