summaryrefslogtreecommitdiffstats
path: root/pyload/setup/system.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-09-29 13:03:17 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-09-29 13:03:17 +0200
commit6a997661dc5c259f844531382a90a4ca120f1233 (patch)
tree085a76d4bac208963649a62f9393e0c0b049e869 /pyload/setup/system.py
parentrewritten decrypter and info fetching thread (diff)
downloadpyload-6a997661dc5c259f844531382a90a4ca120f1233.tar.xz
basics for web setup
Diffstat (limited to 'pyload/setup/system.py')
-rw-r--r--pyload/setup/system.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/pyload/setup/system.py b/pyload/setup/system.py
new file mode 100644
index 000000000..6e7039331
--- /dev/null
+++ b/pyload/setup/system.py
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+
+import sys
+import os
+
+# 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 = {
+ _("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