BugFix and error reporting

* Fix a bug if the macro path is invalid
* reporting exeptions if somethings fail in the Draft core modules init
This commit is contained in:
jriegel 2014-01-25 04:56:57 +01:00
parent 15406d1498
commit 9a2fab28d2
2 changed files with 4 additions and 3 deletions

View File

@ -100,8 +100,9 @@ class DraftWorkbench (Workbench):
FreeCADGui.addLanguagePath(":/translations") FreeCADGui.addLanguagePath(":/translations")
FreeCADGui.addIconPath(":/icons") FreeCADGui.addIconPath(":/icons")
self.appendMenu(["&Macro",translate("draft","Installed Macros")],macros.macrosList) self.appendMenu(["&Macro",translate("draft","Installed Macros")],macros.macrosList)
except: except Exception as inst:
pass print inst
FreeCAD.Console.PrintError("Error: Initializing one or more of the Draft modules failed, Draft will not work as expected.\n")
# setup menus # setup menus
self.cmdList = ["Draft_Line","Draft_Wire","Draft_Circle","Draft_Arc","Draft_Ellipse", self.cmdList = ["Draft_Line","Draft_Wire","Draft_Circle","Draft_Arc","Draft_Ellipse",

View File

@ -40,7 +40,7 @@ class MacroCommand():
if os.path.exists(target): execfile(target) if os.path.exists(target): execfile(target)
if macroPath: if macroPath and os.path.isdir(macroPath):
macros = [] macros = []
for f in os.listdir(macroPath): for f in os.listdir(macroPath):
if ".FCMacro" in f: if ".FCMacro" in f: