pywikitools.resourcesbot.write_sidebar_messages#
Module Contents#
Classes#
Write/update the system messages for the sidebar with the translated titles of worksheets. |
- class pywikitools.resourcesbot.write_sidebar_messages.WriteSidebarMessages(fortraininglib: pywikitools.fortraininglib.ForTrainingLib, site: pywikibot.site.APISite, *, force_rewrite: bool = False)#
Bases:
pywikitools.resourcesbot.post_processing.LanguagePostProcessorWrite/update the system messages for the sidebar with the translated titles of worksheets. These are used when displaying the whole website in another language (changing the “user interface language”)
E.g. write German headline of “Hearing from God” to https://www.4training.net/MediaWiki:Sidebar-hearingfromgod/de
More information on system messages: https://www.mediawiki.org/wiki/Help:System_message
This class can be re-used to call run() several times
- save_worksheet_title(self, worksheet: pywikitools.resourcesbot.data_structures.WorksheetInfo)#
Save system message with the title of the given worksheet.
- static has_relevant_change(worksheet: str, change_log: pywikitools.resourcesbot.changes.ChangeLog) → bool#
Is there a relevant change for our worksheet? Relevant is a change indicating that the translated title might have changed (new / updated worksheet)
- run(self, language_info: pywikitools.resourcesbot.data_structures.LanguageInfo, english_info: pywikitools.resourcesbot.data_structures.LanguageInfo, change_log: pywikitools.resourcesbot.changes.ChangeLog) → None#
Our entry function