App: add default macro directory to sys.path

This commit is contained in:
wmayer
2022-06-01 11:21:51 +02:00
parent eda43a2ef9
commit 8c123bad50

View File

@@ -111,7 +111,8 @@ def InitApplications():
AddPath = FreeCAD.ConfigGet("AdditionalModulePaths").split(";")
HomeMod = FreeCAD.getUserAppDataDir()+"Mod"
HomeMod = os.path.realpath(HomeMod)
MacroDir = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro").GetString("MacroPath")
MacroStd = App.getUserMacroDir(False)
MacroDir = App.getUserMacroDir(True)
MacroMod = os.path.realpath(MacroDir+"/Mod")
SystemWideMacroDir = FreeCAD.getHomePath()+'Macro'
SystemWideMacroDir = os.path.realpath(SystemWideMacroDir)
@@ -278,6 +279,7 @@ def InitApplications():
for i in path:
Log(" " + i + "\n")
# add MacroDir to path (RFE #0000504)
sys.path.append(MacroStd)
sys.path.append(MacroDir)
# add SystemWideMacroDir to path
sys.path.append(SystemWideMacroDir)