Skip to content

Commit

Permalink
Arch: changed download folder to use the macros folder pref setting
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Apr 24, 2014
1 parent db72aa2 commit 79efe68
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Mod/Arch/ArchCommands.py
Expand Up @@ -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:
Expand Down

0 comments on commit 79efe68

Please sign in to comment.