Skip to content
Snippets Groups Projects
Commit 862495a7 authored by Papeleux Luc's avatar Papeleux Luc
Browse files

remove not working AllUser option in externalProgramPath

parent 61a0d059
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# Define external program paths according to local configuration # Define external program paths according to local configuration
from prmClasses import * from prmClasses import *
import os, os.path, shutil #,distutils.spawn import os, os.path, distutils.spawn
class ExtProgs(PRMSet): class ExtProgs(PRMSet):
def __init__(self, verb=False): def __init__(self, verb=False):
...@@ -16,8 +16,13 @@ class ExtProgs(PRMSet): ...@@ -16,8 +16,13 @@ class ExtProgs(PRMSet):
def loadPaths(self): def loadPaths(self):
home = os.path.expanduser("~") home = os.path.expanduser("~")
loc = os.path.abspath('.') #print("sys.path[0] = ", sys.path[0])
return [home, loc] #loc = os.path.abspath('.') non, '.' n'est pas le programDir (et pas vident de le trouver entre version Dev & installed)
# et sys.path[0] est le baseDir (pas le programDir !!!)
#print("home Path = ", home)
#print("local Path = ", loc)
#return [home, loc]
return [home]
def savePath(self): def savePath(self):
home = os.path.expanduser("~") home = os.path.expanduser("~")
...@@ -66,12 +71,10 @@ class ExtProgs(PRMSet): ...@@ -66,12 +71,10 @@ class ExtProgs(PRMSet):
print("\t 3. If %s not in the Script last version, add it program in the Script..."%key) print("\t 3. If %s not in the Script last version, add it program in the Script..."%key)
return False 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 return True
else: else:
print("%s is not found at %s ..."%(key, self.pars[key].val)) print("%s is not found in %s ..."%(key, self.pars[key].val))
print("\t Check installation and accessibility...") print("\t Check installation and accessibility...")
print("\t Use 'externalProgramPathGui' to define the full program path (recommanded)") print("\t Use 'externalProgramPathGui' to define the full program path (recommanded)")
print("\t or add %s in your user path (not recommanded)"%key) print("\t or add %s in your user path (not recommanded)"%key)
......
...@@ -94,12 +94,11 @@ class ExtProgsConfGui(QWidget): ...@@ -94,12 +94,11 @@ class ExtProgsConfGui(QWidget):
grplay2 = QGridLayout() grplay2 = QGridLayout()
grplay2.setColumnStretch(2,1) grplay2.setColumnStretch(2,1)
self.mesherGrpBox.setLayout(grplay2) self.mesherGrpBox.setLayout(grplay2)
self.sf['MATLAB'] = ExeFileLine(self, grplay2, self.extProgPath.pars['MATLAB'], exeFileType, 0, 0, 4) self.sf['MATLAB'] = ExeFileLine(self, grplay2, self.extProgPath.pars['MATLAB'], exeFileType, 0, 0, 4)
if isUnix(): if isUnix():
self.sf['SCILAB'] = ExeFileLine(self, grplay2, self.extProgPath.pars['SCILAB'], exeFileType, 1, 0, 4) self.sf['SCILAB'] = ExeFileLine(self, grplay2, self.extProgPath.pars['SCILAB'], exeFileType, 1, 0, 4)
else: 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'], "bat file (*.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) self.sf['GNUPLOT'] = ExeFileLine(self, grplay2, self.extProgPath.pars['GNUPLOT'], exeFileType, 2, 0, 4)
#Text & image #Text & image
...@@ -124,9 +123,9 @@ class ExtProgsConfGui(QWidget): ...@@ -124,9 +123,9 @@ class ExtProgsConfGui(QWidget):
butlayout.addWidget(self.saveButton1) butlayout.addWidget(self.saveButton1)
self.saveButton1.pressed.connect(self.userSave) self.saveButton1.pressed.connect(self.userSave)
self.saveButton2 = QPushButton(self.tr("All Users Save")) #self.saveButton2 = QPushButton(self.tr("All Users Save"))
butlayout.addWidget(self.saveButton2) #butlayout.addWidget(self.saveButton2)
self.saveButton2.pressed.connect(self.progSave) #self.saveButton2.pressed.connect(self.progSave)
self.quitButton = QPushButton(self.tr("Quit")) self.quitButton = QPushButton(self.tr("Quit"))
butlayout.addWidget(self.quitButton) butlayout.addWidget(self.quitButton)
...@@ -158,12 +157,12 @@ class ExtProgsConfGui(QWidget): ...@@ -158,12 +157,12 @@ class ExtProgsConfGui(QWidget):
if self.extProgPath.debug : if self.extProgPath.debug :
print("Save pressed") print("Save pressed")
self.extProgPath.savePars() self.extProgPath.savePars()
'''
def progSave(self): def progSave(self):
if self.extProgPath.debug : if self.extProgPath.debug :
print("Save pressed") print("Save pressed")
self.extProgPath.savePars('.') self.extProgPath.savePars('.')
'''
def quit(self): def quit(self):
if self.extProgPath.debug : if self.extProgPath.debug :
print("Quit pressed") print("Quit pressed")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment