diff --git a/externalProgramPath.py b/externalProgramPath.py index d31dc0c3543bce5abf8490c51ff46f5ff6b5b36a..f72b659245f2f7390b7bf50deaf9358acfcdb214 100755 --- a/externalProgramPath.py +++ b/externalProgramPath.py @@ -4,7 +4,7 @@ # Define external program paths according to local configuration from prmClasses import * -import os, os.path, distutils.spawn +import os, os.path, shutil #,distutils.spawn class ExtProgs(PRMSet): def __init__(self, verb=False): @@ -66,10 +66,12 @@ class ExtProgs(PRMSet): print("\t 3. If %s not in the Script last version, add it program in the Script..."%key) return False - if distutils.spawn.find_executable(os.path.splitext(self.pars[key].val)[0]) : + #if distutils.spawn.find_executable(os.path.splitext(self.pars[key].val)[0]) : + #if os.path.exists(self.pars[key].val) : + if shutil.which(self.pars[key].val) : return True else: - print("%s is not found in %s ..."%(key, self.pars[key].val)) + print("%s is not found at %s ..."%(key, self.pars[key].val)) print("\t Check installation and accessibility...") print("\t Use 'externalProgramPathGui' to define the full program path (recommanded)") print("\t or add %s in your user path (not recommanded)"%key) diff --git a/externalProgramPathGui.pyw b/externalProgramPathGui.pyw index 9f35f5633301f9e36c3096eb27e86e52f70fdee8..4b9557d2cf1a0e21e01025db34f1f9af409dc419 100755 --- a/externalProgramPathGui.pyw +++ b/externalProgramPathGui.pyw @@ -94,8 +94,12 @@ class ExtProgsConfGui(QWidget): grplay2 = QGridLayout() grplay2.setColumnStretch(2,1) self.mesherGrpBox.setLayout(grplay2) - self.sf['MATLAB'] = ExeFileLine(self, grplay2, self.extProgPath.pars['MATLAB'], exeFileType, 0, 0, 4) - self.sf['SCILAB'] = ExeFileLine(self, grplay2, self.extProgPath.pars['SCILAB'], exeFileType, 1, 0, 4) + self.sf['MATLAB'] = ExeFileLine(self, grplay2, self.extProgPath.pars['MATLAB'], exeFileType, 0, 0, 4) + if isUnix(): + self.sf['SCILAB'] = ExeFileLine(self, grplay2, self.extProgPath.pars['SCILAB'], exeFileType, 1, 0, 4) + else: + self.sf['SCILAB'] = ExeFileLine(self, grplay2, self.extProgPath.pars['SCILAB'], "bat files (*.bat)", 1, 0, 4) + #self.sf['SCILAB'] = ExeFileLine(self, grplay2, self.extProgPath.pars['SCILAB'], exeFileType, 1, 0, 4) self.sf['GNUPLOT'] = ExeFileLine(self, grplay2, self.extProgPath.pars['GNUPLOT'], exeFileType, 2, 0, 4) #Text & image @@ -104,8 +108,8 @@ class ExtProgsConfGui(QWidget): grplay3 = QGridLayout() grplay3.setColumnStretch(2,1) self.mesherGrpBox.setLayout(grplay3) - self.sf['LATEX'] = ExeFileLine(self, grplay3, self.extProgPath.pars['LATEX'], exeFileType, 0, 0, 4) - self.sf['GHOSTSCRIPT'] = ExeFileLine(self, grplay3, self.extProgPath.pars['GHOSTSCRIPT'], exeFileType, 1, 0, 4) + self.sf['LATEX'] = ExeFileLine(self, grplay3, self.extProgPath.pars['LATEX'], exeFileType, 0, 0, 4) + self.sf['GHOSTSCRIPT'] = ExeFileLine(self, grplay3, self.extProgPath.pars['GHOSTSCRIPT'], exeFileType, 1, 0, 4) self.sf['IMAGEMAGICK'] = ExeFileLine(self, grplay3, self.extProgPath.pars['IMAGEMAGICK'], exeFileType, 2, 0, 4) def buildButtonFrame(self, box):