I'm building a small pywikibot tool which is designed to be installed
via pip (and in turn installs Pywikibot via pip).
The tool uses the page.touch() function which is where I get a
pywikibot.i18n.TranslationError when I run it.
page.touch() gets it's edit summary from i18n.twtranslate(self.site,
'pywikibot-touch') which in turn is defined in /scripts/i18n/pywikibot/.
Unless I'm confused the Error occurs because the pip distribution does not
include the /scripts folder or the i18n submodule.
So my first question is am I just doing something obviously wrong and the
i18n submodule should have been available over pip as well?
If it's not just me then would it not make sense to have any i18n files
necessary to the Pywikibot *library* to also be distributed via the same
pip package? (i18n for scripts is another issue since for scripts you
cannot use pip).
André / Lokal_Profil
André Costa | Chief Operating Officer, Wikimedia Sverige |
Andre.Costa(a)wikimedia.se | +46 (0)733-964574
Stöd fri kunskap, bli medlem i Wikimedia Sverige.
Läs mer på blimedlem.wikimedia.se
sent from my mobile, all typos are due to autocorrect ;)
a new stable release 6.0 will be deployed soon. There are some important points with this release, currently implemented in master branch:
- Support for MediaWiki < 1.23 will been dropped after fandom wikis updated most platforms to MW 1.33. (T268979)
- comms.requests returns a requests.Response object instead of plain text. Normally this does not care because comms.requests result is passed through data.api anyway. But this changes enables to use a lot of requests functionality like exception handling, json conversion, encodings and we have access to headers response and others. Thanks to Mpaa who made a lot of commits to get the this done.
- config.db_hostname was renamed to db_hostname_format to take into account that replicas hosts got redesigned and may have different host names.
- APISite.loadimageinfo no longer returns any content; it just loads it to the instance cache.
- A lot of scripts will be moved to archive folder (T223826). They are still usable if you add 'scripts.archive' to user_script_paths variable in cuser-config.py but they aren't actively maintained. Please visit https://phabricator.wikimedia.org/T223826 and mark scripts you need. After moving to archive, just open a task to recover a script to be developed further. Currently archived scripts (featured.py and cfd.py) will be removed.
- Load time of Wikibase access to SiteLinks will be decreased a lot. Currently retrieving data from an ItemPage needs upto 6 minutes; after that change it might be only seconds. Using toJSON() method to a SiteLinkCollection will still need time to create the data dict. You may use a maintenance script "preload_pages.py" to optimize you bot in this special case.
Refer https://github.com/wikimedia/pywikibot/blob/master/ROADMAP.rst for the full changelog of the current release and https://github.com/wikimedia/pywikibot/blob/master/HISTORY.rst for all release changes.
A lot of thanks to all who have contributed new code or reviewed proposed changed. Also thanks for all reported bugs, improvement proposals and feature request. Thanks using Pywikibot.
Thanks for participating to "2020 Coolest Tool Award Winner": https://meta.wikimedia.org/wiki/Coolest_Tool_Award.
Thank you all