jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/832965 )
Change subject: [IMPR] Short site value can be given
......................................................................
[IMPR] Short site value can be given
Short site value can be given if site code is equal to family like
``-site:meta`` or ``-site:commons``. This is similar than to create
a site with the Site creator: site = Site('commons').
Change-Id: I951773b6509ddd18f04f63844a7ac21bad4e059c
---
M pywikibot/bot.py
1 file changed, 7 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 6aaa9f0..e1bf683 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -876,6 +876,9 @@
toggling the value. Refer :func:`tools.strtobool` for valid values.
.. versionchanged:: 7.7
*-config* global option was added.
+ .. versionchanged:: 8.0
+ Short site value can be given if site code is equal to family
+ like ``-site:meta``.
:param args: Command line arguments. If None,
:meth:`pywikibot.argvu<userinterfaces._interface_base.ABUIC.argvu>`
@@ -909,7 +912,10 @@
elif option in ('-config', '-dir'):
pass
elif option == '-site':
- config.family, config.mylang = value.split(':')
+ if ':' in value:
+ config.family, config.mylang = value.split(':')
+ else:
+ config.family = config.mylang = value
elif option == '-family':
config.family = value
elif option == '-lang':
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/832965
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I951773b6509ddd18f04f63844a7ac21bad4e059c
Gerrit-Change-Number: 832965
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged