def get_binary(self): # set the binary path to the FreeCAD defaults # ATM pure unix shell commands without path names are used as standard # TODO the binaries provided with the FreeCAD distribution should be found # without any additional user input # see ccxttols, it works for Windows and Linux there binary = self.default FreeCAD.Console.PrintLog( "Solver binary path default: {} \n".format(binary)) # check if use_default is set to True # if True the standard binary path will be overwritten with a user binary path if self.param_group.GetBool(self.use_default, True) is False: binary = self.param_group.GetString(self.custom_path) FreeCAD.Console.PrintLog( "Solver binary path user setting: {} \n".format(binary)) # get the whole binary path name for the given command or binary path and return it # None is returned if the binary has not been found # The user does not know what exactly has going wrong. from distutils.spawn import find_executable as find_bin the_found_binary = find_bin(binary) if the_found_binary is None: FreeCAD.Console.PrintError( "The binary has not been found. Full binary search path: {}\n". format(binary)) FreeCAD.Console.PrintLog( "Solver binary found path: {}\n".format(the_found_binary)) return the_found_binary
def get_binary(self): # set the binary path to the FreeCAD defaults # ATM pure unix shell commands without path names are used binary = self.default FreeCAD.Console.PrintLog("Solver binary path: {} \n".format(binary)) # check if use_default is set to True # if True the standard binary path will be overwritten with a user binary path if self.param_group.GetBool(self.use_default, True) is False: binary = self.param_group.GetString(self.custom_path) FreeCAD.Console.PrintLog("Solver binary path: {} \n".format(binary)) # get the whole binary path name for the given command or binary path and return it from distutils.spawn import find_executable as find_bin return find_bin(binary)
def get_binary(self): # set the binary path to the FreeCAD defaults, ATM pure unix shell commands without path names are used # TODO see todo on use_default later in this module binary = self.default FreeCAD.Console.PrintLog('Solver binary path: {} \n'.format(binary)) # check if use_default is set to True # if True the standard binary path will be overwritten with a user binary path if self.param_group.GetBool(self.use_default, True) is False: binary = self.param_group.GetString(self.custom_path) FreeCAD.Console.PrintLog('Solver binary path: {} \n'.format(binary)) # get the whole binary path name for the given command or binary path and return it from distutils.spawn import find_executable as find_bin return find_bin(binary)