jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/736824 )
Change subject: [IMPR] Show an empty string if a environment variable is empty ......................................................................
[IMPR] Show an empty string if a environment variable is empty
If a environment variable is empty, nothing is printed. Now show an empty string delimited by quotes if a environment variable is empty. Also use repr() for family names instead of double quotes.
Change-Id: Ie044d8e58418ce7e4c756d4b7935b33e8d0d6f80 --- M scripts/version.py 1 file changed, 4 insertions(+), 4 deletions(-)
Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/version.py b/scripts/version.py index e4fa31a..9a2cf3d 100755 --- a/scripts/version.py +++ b/scripts/version.py @@ -85,15 +85,15 @@ settings.update(['PYWIKIBOT_DIR', 'PYWIKIBOT_DIR_PWB', 'PYWIKIBOT_NO_USER_CONFIG']) for environ_name in sorted(settings): - pywikibot.output('{}: {}'.format(environ_name, - os.environ.get(environ_name, - 'Not set'))) + pywikibot.output( + '{}: {}'.format(environ_name, + os.environ.get(environ_name, 'Not set') or "''"))
pywikibot.output('Config base dir: ' + pywikibot.config.base_dir) for family, usernames in pywikibot.config.usernames.items(): if not usernames: continue - pywikibot.output('Usernames for family "{}":'.format(family)) + pywikibot.output('Usernames for family {!r}:'.format(family)) for lang, username in usernames.items(): pywikibot.output('\t{}: {}'.format(lang, username))