From: jfa Date: Tue, 14 Apr 2020 08:47:24 +0000 (+0300) Subject: Fix for bos #18341: HOME environment variable X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fjfa%2F18341_HOME;p=modules%2Fsmesh.git Fix for bos #18341: HOME environment variable --- diff --git a/src/Tools/MGCleanerPlug/MGCleanerMonPlugDialog.py b/src/Tools/MGCleanerPlug/MGCleanerMonPlugDialog.py index 470cadbfe..f175090b4 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 9458af6c2..397948ff6 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 111a2ba0f..67917588a 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 e1f610b26..bca83604d 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 cb140d87f..6ca6fbe7d 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 297b7061a..88efdc1b9 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("")