class CatalogServer(Server):
SCMD1=['SALOME_ModuleCatalog_Server','-common']
- SCMD2=['-personal','${HOME}/Salome/resources/CatalogModulePersonnel.xml']
+ home_dir=os.path.expanduser("~")
+ SCMD2=['-personal',os.path.join(home_dir,'Salome', 'resources', 'CatalogModulePersonnel.xml')]
def setpath(self,liste_modules):
cata_path=[]
#
# 1.2. Le repertoire de calcul
#
- if "HOME" in os.environ :
- HOME = os.environ ["HOME"]
- else :
- HOME = "/local/home/salome"
-#
- if ( self.rep_calc[:1] == "~" ) :
- self.rep_calc = os.path.join(HOME, self.rep_calc[2:])
+ self.rep_calc = os.path.expanduser(self.rep_calc)
if not os.path.isdir(self.rep_calc) :
self.message_info += "Repertoire " + self.rep_calc
erreur = -4
#
fic = self.mesh_file
#
- if ( fic[:1] == "~" ) :
- fic = os.path.join(HOME, fic[2:])
+ fic = os.path.expanduser(fic)
if not os.path.isfile(fic) :
aux = os.path.join(self.rep_calc, fic)
if not os.path.isfile(aux) :
#
# 1.2. Le repertoire de calcul
#
- if "HOME" in os.environ :
- HOME = os.environ ["HOME"]
- else :
- HOME = "/local/home/salome"
-#
- if ( self.rep_calc[:1] == "~" ) :
- self.rep_calc = os.path.join(HOME, self.rep_calc[2:])
+ self.rep_calc = os.path.expanduser(self.rep_calc)
if not os.path.isdir(self.rep_calc) :
self.message_info += "Repertoire " + self.rep_calc
erreur = -4
#
fic = self.mesh_file
#
- if ( fic[:1] == "~" ) :
- fic = os.path.join(HOME, fic[2:])
+ fic = os.path.expanduser(fic)
if not os.path.isfile(fic) :
aux = os.path.join(self.rep_calc, fic)
if not os.path.isfile(aux) :
#include "utilities.h"
#include "Basics_Utils.hxx"
+#include "Basics_DirUtils.hxx"
#include "Utils_SINGLETON.hxx"
#include "Utils_CorbaException.hxx"
#include "SALOMEDS_Tool.hxx"
if ( ok )
{
std::string PrefFile ;
- PrefFile = getenv("HOME") ;
+ PrefFile = Kernel_Utils::HomePath() ;
PrefFile += "/.config/salome/SalomeApprc." + salome_version ;
MESSAGE ( "PrefFile = "<<PrefFile ) ;