summaryrefslogtreecommitdiffstats
path: root/pyload/setup/system.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/setup/system.py')
-rw-r--r--pyload/setup/system.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/pyload/setup/system.py b/pyload/setup/system.py
new file mode 100644
index 000000000..dab6d1d17
--- /dev/null
+++ b/pyload/setup/system.py
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+
+import sys
+import os
+
+from new_collections import OrderedDict
+
+# gettext decorator, translated only when needed
+_ = lambda x: x
+
+# platform usually don't change at runtime
+info = None
+
+
+def get_system_info():
+ """ Returns system information as dict """
+ global info
+
+ if info is None:
+ import platform
+
+ info = OrderedDict([
+ (_("Platform"), platform.platform()),
+ (_("Version"), sys.version),
+ (_("Path"), os.path.abspath("")),
+ (_("Encoding"), sys.getdefaultencoding()),
+ (_("FS-Encoding"), sys.getfilesystemencoding())
+ ])
+
+ return info \ No newline at end of file