Skip to content

Commit

Permalink
+ proper exception handling of FemGui module
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Oct 22, 2015
1 parent 62da383 commit abd6e8c
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions src/Mod/Fem/Gui/AppFemGui.cpp
Expand Up @@ -68,7 +68,7 @@ extern struct PyMethodDef FemGui_Import_methods[];

/* Python entry */
extern "C" {
void FemGuiExport initFemGui()
void FemGuiExport initFemGui()
{
if (!Gui::Application::Instance) {
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
Expand Down Expand Up @@ -102,19 +102,25 @@ void FemGuiExport initFemGui()
FemGui::ViewProviderResult ::init();
FemGui::ViewProviderResultPython ::init();

Base::Interpreter().loadModule("FemCommands");
try {
Base::Interpreter().loadModule("FemCommands");

Base::Interpreter().loadModule("_CommandMechanicalShowResult");
Base::Interpreter().loadModule("_CommandQuickAnalysis");
Base::Interpreter().loadModule("_CommandPurgeFemResults");
Base::Interpreter().loadModule("_CommandMechanicalJobControl");
Base::Interpreter().loadModule("_CommandFemFromShape");
Base::Interpreter().loadModule("_CommandNewMechanicalAnalysis");
Base::Interpreter().loadModule("_CommandMechanicalShowResult");
Base::Interpreter().loadModule("_CommandQuickAnalysis");
Base::Interpreter().loadModule("_CommandPurgeFemResults");
Base::Interpreter().loadModule("_CommandMechanicalJobControl");
Base::Interpreter().loadModule("_CommandFemFromShape");
Base::Interpreter().loadModule("_CommandNewMechanicalAnalysis");

Base::Interpreter().loadModule("MechanicalAnalysis");
Base::Interpreter().loadModule("MechanicalMaterial");
Base::Interpreter().loadModule("FemBeamSection");
Base::Interpreter().loadModule("FemShellThickness");
Base::Interpreter().loadModule("MechanicalAnalysis");
Base::Interpreter().loadModule("MechanicalMaterial");
Base::Interpreter().loadModule("FemBeamSection");
Base::Interpreter().loadModule("FemShellThickness");
}
catch (const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
return;
}

// register preferences pages
new Gui::PrefPageProducer<FemGui::DlgSettingsFemImp> ("FEM");
Expand Down

0 comments on commit abd6e8c

Please sign in to comment.