From 79efe68e2581b350e04fdaebbd4a65ce3105a54a Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Thu, 24 Apr 2014 18:53:06 -0300 Subject: [PATCH] Arch: changed download folder to use the macros folder pref setting --- src/Mod/Arch/ArchCommands.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Mod/Arch/ArchCommands.py b/src/Mod/Arch/ArchCommands.py index abf325a8c..4d25e0673 100644 --- a/src/Mod/Arch/ArchCommands.py +++ b/src/Mod/Arch/ArchCommands.py @@ -544,10 +544,14 @@ def mergeCells(objectslist): def download(url,force=False): '''downloads a file from the given URL and saves it in the - user directory. Returns the path to the saved file''' + macro path. Returns the path to the saved file''' import urllib2, os name = url.split('/')[-1] - filepath = os.path.join(FreeCAD.ConfigGet("UserAppData"),name) + p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro") + macropath = p.GetString("MacroPath","") + if not macropath: + macropath = FreeCAD.ConfigGet("UserAppData") + filepath = os.path.join(macropath,name) if os.path.exists(filepath) and not(force): return filepath try: