From 51b115700db40f9302e7a992b264580f15c3063c Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 26 Jul 2015 08:19:58 -0400 Subject: Helper --- lab/platform_info.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lab/platform_info.py (limited to 'lab') diff --git a/lab/platform_info.py b/lab/platform_info.py new file mode 100644 index 0000000..8caea50 --- /dev/null +++ b/lab/platform_info.py @@ -0,0 +1,26 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt + +"""Dump information so we can get a quick look at what's available.""" + +import platform +import sys + + +def whatever(f): + try: + return f() + except: + return f + + +def dump_module(mod): + print("\n### {0} ---------------------------".format(mod.__name__)) + for name in dir(mod): + if name.startswith("_"): + continue + print("{0:30s}: {1!r:.100}".format(name, whatever(getattr(mod, name)))) + + +for mod in [platform, sys]: + dump_module(mod) -- cgit v1.2.1