Skip to content

Commit

Permalink
update simulator file extension to exe & manylinux
Browse files Browse the repository at this point in the history
  • Loading branch information
fdobad committed Aug 29, 2024
1 parent 6ca9932 commit 79c1874
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions fireanalyticstoolbox/algorithm_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from datetime import datetime
from math import isclose
from multiprocessing import cpu_count
from os import chmod, kill, sep
from os import chmod, kill, popen, sep
from pathlib import Path
from platform import machine as platform_machine
from platform import system as platform_system
Expand Down Expand Up @@ -947,12 +947,21 @@ def get_ext() -> str:
ext = ""
if platform_system() == "Windows":
ext = ".exe"
elif platform_system() == "Linux":
ext = ""
# ext = (
# "."
# + popen("lsb_release --short --id 2>/dev/null").read().strip()
# + "."
# + popen("lsb_release --short --codename 2>/dev/null").read().strip()
# + "."
# + popen("uname --machine 2>/dev/null").read().strip()
# )
elif platform_system() == "Darwin":
if platform_machine() == "arm64":
ext = ".Darwin.arm64"
elif platform_machine() == "x86_64":
ext = ".Darwin.x86_64"
else:
ext = f".{platform_system()}.{platform_machine()}"

if ext not in [".exe", ".Linux.x86_64", ".Darwin.arm64", ".Darwin.x86_64"]:
QgsMessageLog.logMessage(f"Untested platform: {ext}", tag=TAG, level=Qgis.Warning)
if ext == ".Darwin.arm64":
QgsMessageLog.logMessage(f"Build not automated, probably using old binary: {ext}", tag=TAG, level=Qgis.Warning)

raise QgsProcessingException(f"Unsupported platform: {platform_system()}")
return ext

0 comments on commit 79c1874

Please sign in to comment.