mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-06-07 14:32:40 -04:00
Cleanup
This commit is contained in:
parent
a6eeac14d2
commit
c07e968218
1 changed files with 13 additions and 26 deletions
39
RNS/vendor/platformutils.py
vendored
39
RNS/vendor/platformutils.py
vendored
|
@ -1,36 +1,26 @@
|
||||||
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"
|
||||||
elif "ANDROID_ROOT" in environ:
|
|
||||||
return "android"
|
|
||||||
else:
|
else:
|
||||||
import sys
|
import sys
|
||||||
return sys.platform
|
return sys.platform
|
||||||
|
|
||||||
def is_linux():
|
def is_linux():
|
||||||
if get_platform() == "linux":
|
if get_platform() == "linux": return True
|
||||||
return True
|
else: return False
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
def is_darwin():
|
def is_darwin():
|
||||||
if get_platform() == "darwin":
|
if get_platform() == "darwin": return True
|
||||||
return True
|
else: return False
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
def is_android():
|
def is_android():
|
||||||
if get_platform() == "android":
|
if get_platform() == "android": return True
|
||||||
return True
|
else: return False
|
||||||
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
|
else: return False
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
def use_epoll():
|
def use_epoll():
|
||||||
if is_linux() or is_android(): return True
|
if is_linux() or is_android(): return True
|
||||||
|
@ -43,8 +33,7 @@ def use_af_unix():
|
||||||
def platform_checks():
|
def platform_checks():
|
||||||
if is_windows():
|
if is_windows():
|
||||||
import sys
|
import sys
|
||||||
if sys.version_info.major >= 3 and sys.version_info.minor >= 8:
|
if sys.version_info.major >= 3 and sys.version_info.minor >= 8: pass
|
||||||
pass
|
|
||||||
else:
|
else:
|
||||||
import RNS
|
import RNS
|
||||||
RNS.log("On Windows, Reticulum requires Python 3.8 or higher.", RNS.LOG_ERROR)
|
RNS.log("On Windows, Reticulum requires Python 3.8 or higher.", RNS.LOG_ERROR)
|
||||||
|
@ -53,7 +42,5 @@ def platform_checks():
|
||||||
|
|
||||||
def cryptography_old_api():
|
def cryptography_old_api():
|
||||||
import cryptography
|
import cryptography
|
||||||
if cryptography.__version__ == "2.8":
|
if cryptography.__version__ == "2.8": return True
|
||||||
return True
|
else: return False
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue