jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/608046 )
Change subject: [doc] use version from pywikibot/__init__ ......................................................................
[doc] use version from pywikibot/__init__
- Use pywikibot.__version__ for writelogheader in bot.py - Use pywikibot.__version__ for default_edit_summary in config2.py - Change doc in i18n.py and CONTENT.rst
detached from I7ffe9096fece8c
Bug: T197936 Change-Id: I652ac978134f7ae7105a131464c3398ae8614f88 --- M CONTENT.rst M pywikibot/bot.py M pywikibot/config2.py M pywikibot/i18n.py 4 files changed, 8 insertions(+), 6 deletions(-)
Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
diff --git a/CONTENT.rst b/CONTENT.rst index 89771af..a5aa3bb 100644 --- a/CONTENT.rst +++ b/CONTENT.rst @@ -27,7 +27,7 @@ | README.rst | Short info string used by Pywikibot Nightlies | +---------------------------+------------------------------------------------------+ | README-conversion.txt | Guide to converting bot scripts from version 1 | - | | of the Pywikibot framework to version 3 | + | | of the Pywikibot framework to current version | +---------------------------+------------------------------------------------------+ | requirements.txt | General PIP requirements file | +---------------------------+------------------------------------------------------+ diff --git a/pywikibot/bot.py b/pywikibot/bot.py index c111c31..9588c26 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -374,7 +374,8 @@ if not http or not hasattr(http, 'threads') or not len(http.threads): return
- log('=== Pywikibot framework v3.0 -- Logging header ===') + log('=== Pywikibot framework v{} -- Logging header ===' + .format(pywikibot.__version__))
# script call log('COMMAND: {0}'.format(sys.argv)) diff --git a/pywikibot/config2.py b/pywikibot/config2.py index e57eb83..01dee15 100644 --- a/pywikibot/config2.py +++ b/pywikibot/config2.py @@ -55,6 +55,7 @@
from requests import __version__ as requests_version
+from pywikibot import __version__ as pwb_version from pywikibot.logging import error, output, warning from pywikibot.tools import PY2, issue_deprecation_warning
@@ -237,7 +238,7 @@ # edit summary to use if not supplied by bot script # WARNING: this should NEVER be used in practice, ALWAYS supply a more # relevant summary for bot edits -default_edit_summary = 'Pywikibot 3.0-dev' +default_edit_summary = 'Pywikibot ' + pwb_version
# What permissions to use to set private files to it # such as password file. diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py index 73fb7f0..99f5d40 100644 --- a/pywikibot/i18n.py +++ b/pywikibot/i18n.py @@ -6,10 +6,10 @@ and for TranslateWiki-based translations.
By default messages are assumed to reside in a package called -'scripts.i18n'. In pywikibot 3.0, that package is not packaged -with pywikibot, and pywikibot 3.0 does not have a hard dependency +'scripts.i18n'. In pywikibot 3+, that package is not packaged +with pywikibot, and pywikibot 3+ does not have a hard dependency on any i18n messages. However, there are three user input questions -in pagegenerators which will use i18 messages if they can be loaded. +in pagegenerators which will use i18n messages if they can be loaded.
The default message location may be changed by calling L{set_message_package} with a package name. The package must contain
pywikibot-commits@lists.wikimedia.org