Better Android detection
This commit is contained in:
parent
25620415a0
commit
bec8473695
18
RNS/vendor/platformutils.py
vendored
18
RNS/vendor/platformutils.py
vendored
@ -1,11 +1,25 @@
|
|||||||
def get_platform():
|
def get_platform():
|
||||||
from os import environ
|
from os import environ
|
||||||
if 'ANDROID_ARGUMENT' in environ:
|
if "ANDROID_ARGUMENT" in environ:
|
||||||
return 'android'
|
return "android"
|
||||||
|
elif "ANDROID_ROOT" in environ:
|
||||||
|
return "android"
|
||||||
else:
|
else:
|
||||||
import sys
|
import sys
|
||||||
return sys.platform
|
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():
|
def is_windows():
|
||||||
if str(get_platform()).startswith("win"):
|
if str(get_platform()).startswith("win"):
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user