mirror of
https://github.com/netinvent/npbackup.git
synced 2025-09-05 04:25:28 +08:00
Remove temporary WIP ofunctions.platform
This commit is contained in:
parent
32f9d21c53
commit
1436409a65
4 changed files with 2 additions and 40 deletions
|
@ -26,43 +26,6 @@ from npbackup.core.nuitka_helper import IS_COMPILED
|
|||
# Since development currently follows Python 3.12, let's consider anything below 3.12 as legacy
|
||||
IS_LEGACY = True if (sys.version_info[1] < 12 or python_arch() == "x86") else False
|
||||
|
||||
import os
|
||||
import platform
|
||||
|
||||
|
||||
def python_arch():
|
||||
# type: () -> str
|
||||
"""
|
||||
Get current python interpreter architecture
|
||||
"""
|
||||
if os.name == "nt":
|
||||
arch = platform.machine()
|
||||
if "AMD64" in arch:
|
||||
return "x64"
|
||||
if "ARM64" in arch:
|
||||
return "arm64"
|
||||
if "ARM" in arch:
|
||||
return "arm"
|
||||
if "i386" in arch or "i686" in arch:
|
||||
return "x86"
|
||||
|
||||
# uname property does not exist under windows
|
||||
# pylint: disable=E1101
|
||||
arch = os.uname()[4].lower()
|
||||
|
||||
if "x86_64" in arch:
|
||||
return "x64"
|
||||
# 64 bit arm
|
||||
elif "aarch64" in arch or "armv8" in arch or "arm64" in arch:
|
||||
return "arm64"
|
||||
# 32 bit arm
|
||||
elif "arm" in arch and not 64 in arch:
|
||||
return "arm"
|
||||
elif "i386" in arch or "i686" in arch:
|
||||
return "x86"
|
||||
else:
|
||||
return arch
|
||||
|
||||
|
||||
try:
|
||||
CURRENT_USER = psutil.Process().username()
|
||||
|
|
|
@ -44,7 +44,6 @@ def get_restic_internal_binary(arch: str) -> str:
|
|||
# We don't have restic legacy builds for unixes
|
||||
# so we can drop the -legacy suffix
|
||||
arch = arch.replace("-legacy", "")
|
||||
print(sys.platform.lower())
|
||||
if sys.platform.lower() == "darwin":
|
||||
if arch == "arm64":
|
||||
binary = "restic_*_darwin_arm64"
|
||||
|
|
|
@ -5,7 +5,7 @@ ofunctions.logger_utils>=2.4.2
|
|||
ofunctions.misc>=1.8.0
|
||||
ofunctions.process>=2.1.0
|
||||
ofunctions.threading>=2.2.0
|
||||
ofunctions.platform>=1.5.1
|
||||
ofunctions.platform>=1.5.3
|
||||
ofunctions.random
|
||||
ofunctions.requestor>=1.2.2
|
||||
ofunctions.mailer>=1.3.0
|
||||
|
|
|
@ -5,7 +5,7 @@ ofunctions.logger_utils>=2.4.2
|
|||
ofunctions.misc>=1.8.0
|
||||
ofunctions.process>=2.1.0
|
||||
ofunctions.threading>=2.2.0
|
||||
ofunctions.platform>=1.5.1
|
||||
ofunctions.platform>=1.5.3
|
||||
ofunctions.random
|
||||
ofunctions.requestor>=1.2.2
|
||||
ofunctions.mailer>=1.3.0
|
||||
|
|
Loading…
Add table
Reference in a new issue