From 6a997661dc5c259f844531382a90a4ca120f1233 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 29 Sep 2013 13:03:17 +0200 Subject: basics for web setup --- pyload/setup/system.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pyload/setup/system.py (limited to 'pyload/setup/system.py') 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 -- cgit v1.2.3