From ab46000ce37681e966a28f5e9276420d01df78bd Mon Sep 17 00:00:00 2001 From: jfa Date: Tue, 14 Apr 2020 11:47:24 +0300 Subject: [PATCH] bos #18341: HOME environment variable --- src/Tools/MGCleanerPlug/MGCleanerMonPlugDialog.py | 2 +- src/Tools/MGCleanerPlug/MGCleanerMonViewText.py | 2 +- src/Tools/Verima/Base/versions.py | 2 +- src/Tools/Verima/Stats/job.py | 2 +- src/Tools/YamsPlug/monViewText.py | 2 +- src/Tools/YamsPlug/monYamsPlugDialog.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Tools/MGCleanerPlug/MGCleanerMonPlugDialog.py b/src/Tools/MGCleanerPlug/MGCleanerMonPlugDialog.py index 38fb62f52..ec87a6f82 100644 --- a/src/Tools/MGCleanerPlug/MGCleanerMonPlugDialog.py +++ b/src/Tools/MGCleanerPlug/MGCleanerMonPlugDialog.py @@ -69,7 +69,7 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget): self.PB_MeshFile.setToolTip("source mesh from a file in disk") #Ces parametres ne sont pas remis a rien par le clean - self.paramsFile= os.path.abspath(os.path.join(os.environ["HOME"],".MGCleaner.dat")) + self.paramsFile= os.path.abspath(os.path.join(os.path.expanduser("~"),".MGCleaner.dat")) self.LE_ParamsFile.setText(self.paramsFile) self.LE_MeshFile.setText("") self.LE_MeshSmesh.setText("") diff --git a/src/Tools/MGCleanerPlug/MGCleanerMonViewText.py b/src/Tools/MGCleanerPlug/MGCleanerMonViewText.py index c45e4cdf5..d9a909318 100644 --- a/src/Tools/MGCleanerPlug/MGCleanerMonViewText.py +++ b/src/Tools/MGCleanerPlug/MGCleanerMonViewText.py @@ -81,7 +81,7 @@ class MGCleanerMonViewText(Ui_ViewExe, QDialog): def saveFile(self): #recuperation du nom du fichier - savedir=os.environ['HOME'] + savedir=os.path.expanduser("~") fn, mask = QFileDialog.getSaveFileName(None,"Save File",savedir) if not fn: return ulfile = os.path.abspath(str(fn)) diff --git a/src/Tools/Verima/Base/versions.py b/src/Tools/Verima/Base/versions.py index bb2373b3d..7936dc3ea 100755 --- a/src/Tools/Verima/Base/versions.py +++ b/src/Tools/Verima/Base/versions.py @@ -24,7 +24,7 @@ import subprocess def Chercheversion(salomePath): - home=os.environ['HOME'] + home=os.path.expanduser("~") commande=os.path.abspath(os.path.join(home,salomePath,'salome')) argus="--version" p = subprocess.Popen([commande,argus], stdout=subprocess.PIPE) diff --git a/src/Tools/Verima/Stats/job.py b/src/Tools/Verima/Stats/job.py index 97c6e6134..837dab49b 100644 --- a/src/Tools/Verima/Stats/job.py +++ b/src/Tools/Verima/Stats/job.py @@ -36,7 +36,7 @@ class Job: def execute(self): - home=os.environ['HOME'] + home=os.path.expanduser("~") commande=os.path.abspath(os.path.join(home,self.salomePath,"salome")) script= os.path.abspath(os.path.join(os.path.abspath(__file__),'../..',self.script)) diff --git a/src/Tools/YamsPlug/monViewText.py b/src/Tools/YamsPlug/monViewText.py index f75615f81..d53848354 100644 --- a/src/Tools/YamsPlug/monViewText.py +++ b/src/Tools/YamsPlug/monViewText.py @@ -80,7 +80,7 @@ class MonViewText(Ui_ViewExe, QDialog): def saveFile(self): #recuperation du nom du fichier - savedir=os.environ['HOME'] + savedir=os.path.expanduser("~") fn, mask = QFileDialog.getSaveFileName(None,"Save File",savedir) if not fn: return ulfile = os.path.abspath(str(fn)) diff --git a/src/Tools/YamsPlug/monYamsPlugDialog.py b/src/Tools/YamsPlug/monYamsPlugDialog.py index bfdc2811c..01ecff063 100644 --- a/src/Tools/YamsPlug/monYamsPlugDialog.py +++ b/src/Tools/YamsPlug/monYamsPlugDialog.py @@ -69,7 +69,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget): self.PB_MeshFile.setToolTip("source mesh from a file in disk") #Ces parametres ne sont pas remis a rien par le clean - self.paramsFile= os.path.abspath(os.path.join(os.environ["HOME"],".MGSurfOpt.dat")) + self.paramsFile= os.path.abspath(os.path.join(os.path.expanduser("~"),".MGSurfOpt.dat")) self.LE_ParamsFile.setText(self.paramsFile) self.LE_MeshFile.setText("") self.LE_MeshSmesh.setText("")