jenkins-bot has submitted this change and it was merged. Change subject: [FEAT] Version.py: environ status and usernames ......................................................................
[FEAT] Version.py: environ status and usernames This adds a very basic status information. It shows the usernames (and whether they use sysop names) and the environ values used by pywikibot. Change-Id: Ia700d02d5a767b64868518b62ea737a68f02e374 --- M scripts/version.py 1 file changed, 19 insertions(+), 0 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/version.py b/scripts/version.py index c188b38..fa6af52 100755 --- a/scripts/version.py +++ b/scripts/version.py @@ -20,6 +20,11 @@ except ImportError: httplib2 = {'__version__': 'n/a'} + +def check_environ(environ_name): + pywikibot.output('{0}: {1}'.format(environ_name, os.environ.get(environ_name, 'Not set'))) + + if __name__ == '__main__': pywikibot.output('Pywikibot: %s' % getversion()) pywikibot.output('Release version: %s' % pywikibot.__release__) @@ -39,3 +44,17 @@ pywikibot.output(u' unicode test: triggers problem #3081100') else: pywikibot.output(u' unicode test: ok') + check_environ('PYWIKIBOT2_DIR') + check_environ('PYWIKIBOT2_DIR_PWB') + check_environ('PYWIKIBOT2_NO_USER_CONFIG') + pywikibot.output('Config base dir: {0}'.format(pywikibot.config2.base_dir)) + for family, usernames in pywikibot.config2.usernames.items(): + if usernames: + pywikibot.output('Usernames for family "{0}":'.format(family)) + for lang, username in usernames.items(): + sysop_name = pywikibot.config2.sysopnames.get(family, {}).get(lang) + if not sysop_name: + sysop_name = 'no sysop configured' + elif sysop_name == username: + sysop_name = 'also sysop' + pywikibot.output('\t{0}: {1} ({2})'.format(lang, username, sysop_name)) -- To view, visit https://gerrit.wikimedia.org/r/172118 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia700d02d5a767b64868518b62ea737a68f02e374 Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise <commodorefabia...@gmx.de> Gerrit-Reviewer: John Vandenberg <jay...@gmail.com> Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com> Gerrit-Reviewer: Merlijn van Deen <valhall...@arctus.nl> Gerrit-Reviewer: XZise <commodorefabia...@gmx.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ Pywikibot-commits mailing list Pywikibot-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits