From f1a3276d37c1e8598137b54df51cb0f6bbd0d9b7 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Thu, 10 Dec 2015 13:32:09 +0100 Subject: [PATCH] Bug fix: Add System-wide Macro dir to python path ================================================= Self explanatory, so that macros in system-wide location can import modules therein. --- src/App/FreeCADInit.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/App/FreeCADInit.py b/src/App/FreeCADInit.py index 7c212102c0d2..33637cd3c94c 100644 --- a/src/App/FreeCADInit.py +++ b/src/App/FreeCADInit.py @@ -52,6 +52,8 @@ def InitApplications(): HomeMod = os.path.realpath(HomeMod) MacroDir = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro").GetString("MacroPath") MacroMod = os.path.realpath(MacroDir+"/Mod") + SystemWideMacroDir = FreeCAD.getHomePath()+'Macro' + SystemWideMacroDir = os.path.realpath(SystemWideMacroDir) #print FreeCAD.getHomePath() if os.path.isdir(FreeCAD.getHomePath()+'src\\Tools'): @@ -130,6 +132,8 @@ def InitApplications(): Log(" " + i + "\n") # add MacroDir to path (RFE #0000504) sys.path.append(MacroDir) + # add SystemWideMacroDir to path + sys.path.append(SystemWideMacroDir) # add special path for MacOSX (bug #0000307) import platform if len(platform.mac_ver()[0]) > 0: