From 0da41bb4cc6fbcc012869895ba323ffac73bf1c3 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Tue, 13 Sep 2016 19:31:31 +0100 Subject: [PATCH] FEM: remove working dir and ccx binary check from InitGui - they are duplicates of the methods in FemToolsCcx - FEM could be used without solving too - they only checked for ccx, but we have more solver already --- src/Mod/Fem/InitGui.py | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/src/Mod/Fem/InitGui.py b/src/Mod/Fem/InitGui.py index c3a807623761..7e3893b224eb 100644 --- a/src/Mod/Fem/InitGui.py +++ b/src/Mod/Fem/InitGui.py @@ -60,39 +60,6 @@ def Initialize(self): import _CommandSolverZ88 import _CommandConstraintSelfWeight - import subprocess - from platform import system - ccx_path = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx").GetString("ccxBinaryPath") - if not ccx_path: - try: - if system() == 'Linux': - p1 = subprocess.Popen(['which', 'ccx'], stdout=subprocess.PIPE) - if p1.wait() == 0: - ccx_path = p1.stdout.read().split('\n')[0] - elif system() == 'Windows': - ccx_path = FreeCAD.getHomePath() + 'bin/ccx.exe' - if ccx_path: - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx").SetString("ccxBinaryPath", ccx_path) - else: - FreeCAD.Console.PrintError("CalculiX ccx binary not found! Please set it manually in FEM preferences.\n") - except Exception as e: - FreeCAD.Console.PrintError(e.message) - - import os - working_dir = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/General").GetString("WorkingDir") - if not (os.path.isdir(working_dir)): - try: - os.makedirs(working_dir) - except: - print ("Dir \'{}\' from FEM preferences doesn't exist and cannot be created.".format(working_dir)) - import tempfile - working_dir = tempfile.gettempdir() - print ("Dir \'{}\' will be used instead.".format(working_dir)) - if working_dir: - FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/General").SetString("WorkingDir", working_dir) - else: - FreeCAD.Console.PrintError("Setting working directory \'{}\' for ccx failed!\n") - def GetClassName(self): return "FemGui::Workbench"