jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[IMPR] Use PrettyPrinter to show config variables

Change-Id: I1441a09c0505e8e3c7e433afaf619fd43987c055
---
M pywikibot/config.py
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pywikibot/config.py b/pywikibot/config.py
index 193ec03..d8ad1ff 100644
--- a/pywikibot/config.py
+++ b/pywikibot/config.py
@@ -1127,6 +1127,8 @@
# When called as main program, list all configuration variables
#
if __name__ == '__main__': # pragma: no cover
+ from pprint import PrettyPrinter as _PrettyPrinter
+ _pp = _PrettyPrinter()
_all = True
for _arg in sys.argv[1:]:
if _arg == 'modified':
@@ -1142,7 +1144,7 @@
_value = globals()[_name]

if _name not in _private_values or not _value:
- _value = repr(_value)
+ _value = _pp.pformat(_value)
elif isinstance(_value, dict):
_value = '{ ...xxxxxxxx... }'
elif hasattr(_value, '__dict__'):

To view, visit change 771852. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I1441a09c0505e8e3c7e433afaf619fd43987c055
Gerrit-Change-Number: 771852
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged