summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-07-26 08:19:58 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-07-26 08:19:58 -0400
commita225fd1a3847b651d000e243759e4149f23682a7 (patch)
tree439df0147c935d9b1d8c7d9f4653e2d2564d824f
parenta6ec143e49b45b94d61423b12e687235f1439035 (diff)
downloadpython-coveragepy-git-a225fd1a3847b651d000e243759e4149f23682a7.tar.gz
Helper
-rw-r--r--lab/platform_info.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/lab/platform_info.py b/lab/platform_info.py
new file mode 100644
index 00000000..8caea50f
--- /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)