From 5ea2bc2213c1351ba1eef6750cde3da03a7b8744 Mon Sep 17 00:00:00 2001 From: lins05 Date: Thu, 17 Apr 2014 11:09:25 +0800 Subject: [PATCH] add function get_platform_name --- seahub/utils/sysinfo.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 seahub/utils/sysinfo.py diff --git a/seahub/utils/sysinfo.py b/seahub/utils/sysinfo.py new file mode 100644 index 0000000000..14775c5bd1 --- /dev/null +++ b/seahub/utils/sysinfo.py @@ -0,0 +1,20 @@ +#coding: UTF-8 + +import platform +import os + +def get_platform_name(): + '''Returns current platform the seafile server is running on. Possible return + values are: + + - 'linux' + - 'windows' + - 'raspberry-pi' + + ''' + if os.name == 'nt': + return 'windows' + elif 'arm' in platform.machine(): + return 'raspberry-pi' + else: + return 'linux'