Extensions: add optional arguments to ThirdPartyPath
authorEdouard Tisserant <edouard@beremiz.fr>
Tue, 09 Jul 2024 11:44:49 +0200
changeset 3983 466be4f52cb9
parent 3982 69d161fc2e08
child 3984 883a85b9ebcc
Extensions: add optional arguments to ThirdPartyPath

ThirdPartyPath("name", "path1", "path2") will resolve by default into "../name/path1/path2"
util/paths.py
--- a/util/paths.py	Thu Jul 04 11:24:04 2024 +0200
+++ b/util/paths.py	Tue Jul 09 11:44:49 2024 +0200
@@ -46,11 +46,11 @@
         path = os.path.dirname(path)
     return path
 
-def ThirdPartyPath(name):
+def ThirdPartyPath(name, *suffixes):
     """
     Return folder where to find sibling projects like Modbus, CanFestival, BACnet
     """
-    return os.path.join(AbsParentDir(__file__, 2), name)
+    return os.path.join(AbsParentDir(__file__, 2), name, *suffixes)
 
 def Bpath(*names):
     """