1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-07 18:03:48 +00:00

add function get_platform_name

This commit is contained in:
lins05
2014-04-17 11:09:25 +08:00
committed by llj
parent 29056488ae
commit 5ea2bc2213

20
seahub/utils/sysinfo.py Normal file
View File

@@ -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'