mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
Support Linux (tested and seems to work)
This commit is contained in:
@@ -21,9 +21,9 @@ import urllib.request
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
available_platforms = ("win32", "darwin")
|
available_platforms = ("win32", "darwin", "linux")
|
||||||
if sys.platform not in available_platforms:
|
if sys.platform not in available_platforms:
|
||||||
print(f"Currently only available on {','.join(available_platforms)}. Not available on {sys.platform}.")
|
print(f"Currently only available on {', '.join(available_platforms)}. Not available on {sys.platform}.")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
@@ -39,9 +39,11 @@ REPO_PATH = r""
|
|||||||
# BLENDER_PATH: Path to Blender's configuration folder.
|
# BLENDER_PATH: Path to Blender's configuration folder.
|
||||||
# Usually don't need to change, just ensure Blender version matches.
|
# Usually don't need to change, just ensure Blender version matches.
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
BLENDER_PATH = Path.home() / r"AppData/Roaming/Blender Foundation/Blender/4.5"
|
BLENDER_PATH = Path.home() / "AppData/Roaming/Blender Foundation/Blender/4.5"
|
||||||
elif sys.platform == "darwin":
|
elif sys.platform == "darwin":
|
||||||
BLENDER_PATH = Path.home() / r"Library/Application Support/Blender/4.5"
|
BLENDER_PATH = Path.home() / "Library/Application Support/Blender/4.5"
|
||||||
|
elif sys.platform == "linux":
|
||||||
|
BLENDER_PATH = Path.home() / ".config/blender/4.5"
|
||||||
else:
|
else:
|
||||||
assert False
|
assert False
|
||||||
|
|
||||||
@@ -62,7 +64,6 @@ def find_bonsai_path() -> Union[Path, None]:
|
|||||||
if path.exists():
|
if path.exists():
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
||||||
# BONSAI_PATH: Path to 'bonsai' extension folder inside BLENDER_PATH.
|
# BONSAI_PATH: Path to 'bonsai' extension folder inside BLENDER_PATH.
|
||||||
# Typically resolved automatically, paths priority can be found in `find_bonsai_path`.
|
# Typically resolved automatically, paths priority can be found in `find_bonsai_path`.
|
||||||
#
|
#
|
||||||
@@ -76,10 +77,6 @@ BONSAI_PATH = find_bonsai_path()
|
|||||||
# Never changed by user.
|
# Never changed by user.
|
||||||
PACKAGE_PATH = BLENDER_PATH / r"extensions/.local/lib/python3.11/site-packages"
|
PACKAGE_PATH = BLENDER_PATH / r"extensions/.local/lib/python3.11/site-packages"
|
||||||
|
|
||||||
# Python doesn't allow using escape sequences in f-strings.
|
|
||||||
NEW_LINE = chr(10)
|
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
global REPO_PATH
|
global REPO_PATH
|
||||||
|
|
||||||
@@ -103,7 +100,7 @@ def main() -> None:
|
|||||||
assert PACKAGE_PATH.exists(), f"Path '{PACKAGE_PATH=!s}' doesn't exist, ensure variable is set correctly."
|
assert PACKAGE_PATH.exists(), f"Path '{PACKAGE_PATH=!s}' doesn't exist, ensure variable is set correctly."
|
||||||
assert BONSAI_PATH is not None, (
|
assert BONSAI_PATH is not None, (
|
||||||
"Couldn't find BONSAI_PATH in any of the paths candidates. "
|
"Couldn't find BONSAI_PATH in any of the paths candidates. "
|
||||||
f"Example paths: {NEW_LINE.join(str(p) for p in BONSAI_PATH_CANDIDATES)}."
|
"Example paths: {}".format("\n".join(str(p) for p in BONSAI_PATH_CANDIDATES))
|
||||||
)
|
)
|
||||||
|
|
||||||
input("Confirm the settings above and press Enter to continue or Ctrl-C to cancel...")
|
input("Confirm the settings above and press Enter to continue or Ctrl-C to cancel...")
|
||||||
|
|||||||
Reference in New Issue
Block a user