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:
20
seahub/utils/sysinfo.py
Normal file
20
seahub/utils/sysinfo.py
Normal 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'
|
Reference in New Issue
Block a user