diff options
Diffstat (limited to 'pyload/setup/system.py')
-rw-r--r-- | pyload/setup/system.py | 28 |
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 |