Better Android detection
This commit is contained in:
parent
25620415a0
commit
bec8473695
|
@ -1,11 +1,25 @@
|
|||
def get_platform():
|
||||
from os import environ
|
||||
if 'ANDROID_ARGUMENT' in environ:
|
||||
return 'android'
|
||||
if "ANDROID_ARGUMENT" in environ:
|
||||
return "android"
|
||||
elif "ANDROID_ROOT" in environ:
|
||||
return "android"
|
||||
else:
|
||||
import sys
|
||||
return sys.platform
|
||||
|
||||
def is_darwin():
|
||||
if get_platform() == "darwin":
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def is_android():
|
||||
if get_platform() == "android":
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def is_windows():
|
||||
if str(get_platform()).startswith("win"):
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue