Create Macro dir for AddonManager if nonexistent

This commit implements the directory-existence-check already used for
the Mod folder when AddonManager attempts to install something into it
and is associated with bug #00029998
This commit is contained in:
Kurt Kremitzki
2017-04-04 19:17:09 -05:00
parent a253af0b9f
commit c902422f63

View File

@@ -205,6 +205,8 @@ class AddonsInstaller(QtGui.QDialog):
self.install_worker.start()
elif self.tabWidget.currentIndex() == 1:
macropath = FreeCAD.ParamGet('User parameter:BaseApp/Preferences/Macro').GetString("MacroPath",os.path.join(FreeCAD.ConfigGet("UserAppData"),"Macro"))
if not os.path.isdir(macropath):
os.makedirs(macropath)
macro = self.macros[self.listMacros.currentRow()]
if len(macro) < 5:
self.labelDescription.setText(QtGui.QApplication.translate("AddonsInstaller", "Unable to install", None, QtGui.QApplication.UnicodeUTF8))