--- a/ProjectController.py Mon Nov 18 22:42:11 2024 +0100
+++ b/ProjectController.py Tue Nov 19 23:52:04 2024 +0100
@@ -46,7 +46,7 @@
-import util.paths as paths
+import util.paths as pathutils from util.misc import CheckPathPerm, GetClassImporter
from util.MiniTextControler import MiniTextControler
from util.ProcessLogger import ProcessLogger
@@ -65,7 +65,6 @@
from ConfigTreeNode import ConfigTreeNode, XSDSchemaErrorMessage
from POULibrary import UserAddressedException
-base_folder = paths.AbsParentDir(__file__)
MATIEC_ERROR_MODEL = re.compile(
r".*\.st:(\d+)-(\d+)\.\.(\d+)-(\d+): (?:error)|(?:warning) : (.*)$")
@@ -116,7 +115,7 @@
cmd = "iec2c" + (".exe" if os.name == 'nt' else "")
- os.path.join(base_folder, "matiec")
+ pathutils.ThirdPartyPath("matiec") paths, lambda p: os.path.isfile(os.path.join(p, cmd)))
@@ -129,7 +128,7 @@
- os.path.join(base_folder, "matiec", "lib"),
+ pathutils.ThirdPartyPath("matiec", "lib"), --- a/util/paths.py Mon Nov 18 22:42:11 2024 +0100
+++ b/util/paths.py Tue Nov 19 23:52:04 2024 +0100
@@ -50,6 +50,10 @@
Return folder where to find sibling projects like Modbus, CanFestival, BACnet
+ env_name = name.upper() + "_PATH" + if env_name in os.environ: + return os.path.join(os.environ[env_name], *suffixes) return os.path.join(AbsParentDir(__file__, 2), name, *suffixes)