Salome HOME
Copyright update 2022
[modules/homard.git] / doc / files / yacs_script_test.py
index 056b87f254237cdef9f8462929b5030a8c16070f..65f8143bad26d39b2fcca1e30cf87cd39d943d1c 100755 (executable)
@@ -1,6 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
-# Copyright (C) 2013-2016  CEA/DEN, EDF R&D
+# Copyright (C) 2013-2022  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -190,13 +190,7 @@ Controle les arguments et stockage de quelques informations
 #
 # 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
@@ -209,8 +203,7 @@ Controle les arguments et stockage de quelques informations
 #
       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) :