diff --git a/src/Mod/Fem/Init.py b/src/Mod/Fem/Init.py index d06b24904f..eb61ae03b7 100644 --- a/src/Mod/Fem/Init.py +++ b/src/Mod/Fem/Init.py @@ -20,13 +20,34 @@ # * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * # * USA * # * * -# ***************************************************************************/ +# *************************************************************************** +"""FEM module App init script -# FreeCAD init script of the Fem module +Gathering all the information to start FreeCAD. +This is the first one of three init scripts. +The third one runs when the gui is up. +The script is executed using exec(). +This happens inside srd/Gui/FreeCADGuiInit.py +All imports made there are available here too. +Thus no need to import them here. +But the import code line is used anyway to get flake8 quired. +Since they are cached they will not be imported twice. +""" + +__title__ = "FEM module App init script" +__author__ = "Juergen Riegel, Bernd Hahnebach" +__url__ = "http://www.freecadweb.org" + +# imports to get flake8 quired import FreeCAD +# add FEM unit tests +FreeCAD.__unit_test__ += ["TestFem"] + + +# add import and export file types FreeCAD.addExportType("FEM mesh Python (*.meshpy)", "feminout.importPyMesh") FreeCAD.addExportType("FEM mesh TetGen (*.poly)", "feminout.convert2TetGen") @@ -55,5 +76,3 @@ FreeCAD.addImportType("FEM result Z88 displacements (*o2.txt)", "feminout.import if "BUILD_FEM_VTK" in FreeCAD.__cmake__: FreeCAD.addImportType("FEM result VTK (*.vtk *.vtu)", "feminout.importVTKResults") FreeCAD.addExportType("FEM result VTK (*.vtk *.vtu)", "feminout.importVTKResults") - -FreeCAD.__unit_test__ += ["TestFem"] diff --git a/src/Mod/Fem/InitGui.py b/src/Mod/Fem/InitGui.py index 2639195c9c..80e02cd595 100644 --- a/src/Mod/Fem/InitGui.py +++ b/src/Mod/Fem/InitGui.py @@ -1,5 +1,6 @@ # *************************************************************************** # * Copyright (c) 2009 Juergen Riegel * +# * Copyright (c) 2020 Bernd Hahnebach * # * * # * This program is free software; you can redistribute it and/or modify * # * it under the terms of the GNU Lesser General Public License (LGPL) * @@ -17,15 +18,29 @@ # * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * # * USA * # * * -# ***************************************************************************/ +# *************************************************************************** +"""FEM module Gui init script -# Fem gui init module -# Gathering all the information to start FreeCAD -# This is the second one of three init scripts -# the third one runs when the gui is up +Gathering all the information to start FreeCAD. +This is the second one of three init scripts. +The third one runs when the gui is up. +The script is executed using exec(). +This happens inside srd/Gui/FreeCADGuiInit.py +All imports made there are available here too. +Thus no need to import them here. +But the import code line is used anyway to get flake8 quired. +Since they are cached they will not be imported twice. +""" + +__title__ = "FEM module Gui init script" +__author__ = "Juergen Riegel, Bernd Hahnebach" +__url__ = "http://www.freecadweb.org" + +# imports to get flake8 quired import FreeCAD import FreeCADGui +from FreeCADGui import Workbench class FemWorkbench(Workbench): @@ -41,6 +56,10 @@ class FemWorkbench(Workbench): import Fem import FemGui import femcommands.commands + # dummy usage to get flake8 and lgtm quiet + False if Fem.__name__ else True + False if FemGui.__name__ else True + False if femcommands.commands.__name__ else True def GetClassName(self): # see https://forum.freecadweb.org/viewtopic.php?f=10&t=43300