Salome HOME
projects
/
modules
/
homard.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated copyright comment
[modules/homard.git]
/
doc
/
files
/
tutorial_util.py
diff --git
a/doc/files/tutorial_util.py
b/doc/files/tutorial_util.py
index 4199ce7752faa7d9e7bb3e193cd323b131d8c4c7..25ab640fd4debceceb98ec15f86fdcf9748ba10c 100755
(executable)
--- a/
doc/files/tutorial_util.py
+++ b/
doc/files/tutorial_util.py
@@
-1,5
+1,5
@@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
-# Copyright (C) 2011-20
15 CEA/DEN, EDF R&D
+# Copyright (C) 2011-20
24 CEA, EDF
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@
-19,9
+19,9
@@
#
"""
Python script for HOMARD
#
"""
Python script for HOMARD
-Copyright EDF
-R&D 2014
+Copyright EDF
2014, 2018
"""
"""
-__revision__ = "V
1.3
"
+__revision__ = "V
2.02
"
import os
import sys
import os
import sys
@@
-33,11
+33,12
@@
REP_PYTHON = os.path.normpath(REP_PYTHON)
sys.path.append(REP_PYTHON)
from test_util import remove_dir
sys.path.append(REP_PYTHON)
from test_util import remove_dir
-#========================================================================
-#========================================================================
+#
+#========================= Debut de la fonction ==================================
+#
def gzip_gunzip(data_dir, num_tuto, option) :
"""
def gzip_gunzip(data_dir, num_tuto, option) :
"""
-Compression/Uncompression of the med
files of a directory such as tutorial_x.nn.med
+Compression/Uncompression of the med
(or xao) files of a directory such as tutorial_x.nn.med (or tutorial_x.nn.xao)
data_dir: directory
num_tuto: number of the tutorial
option : 1: compression, -1: uncompression
data_dir: directory
num_tuto: number of the tutorial
option : 1: compression, -1: uncompression
@@
-66,13
+67,14
@@
Copyright EDF-R&D 2014
erreur = 1
break
#
erreur = 1
break
#
- ficloc = ficloc_basis + ".fr.med"
- nomfic = os.path.join(data_dir, ficloc)
- if not os.path.isfile(nomfic) :
- ficloc += ".gz"
+ for suffixe in ( "xao", "fr.med" ) :
+ ficloc = ficloc_basis + "." + suffixe
nomfic = os.path.join(data_dir, ficloc)
nomfic = os.path.join(data_dir, ficloc)
- if os.path.isfile(nomfic) :
- os.system("gunzip "+nomfic)
+ if not os.path.isfile(nomfic) :
+ ficloc += ".gz"
+ nomfic = os.path.join(data_dir, ficloc)
+ if os.path.isfile(nomfic) :
+ os.system("gunzip "+nomfic)
#
# Compression
#
#
# Compression
#
@@
-91,18
+93,21
@@
Copyright EDF-R&D 2014
erreur = 2
break
#
erreur = 2
break
#
- ficloc = ficloc_basis + ".fr.med.gz"
- nomfic = os.path.join(data_dir, ficloc)
- if not os.path.isfile(nomfic) :
- ficloc = ficloc_basis + ".fr.med"
+ for suffixe in ( "xao", "fr.med" ) :
+ ficloc = ficloc_basis + "." + suffixe + ".gz"
nomfic = os.path.join(data_dir, ficloc)
nomfic = os.path.join(data_dir, ficloc)
- if os.path.isfile(nomfic) :
- os.system("gzip "+nomfic)
+ if not os.path.isfile(nomfic) :
+ ficloc = ficloc_basis + ".fr.med"
+ nomfic = os.path.join(data_dir, ficloc)
+ if os.path.isfile(nomfic) :
+ os.system("gzip "+nomfic)
#
return
#
#
return
#
-#========================================================================
-#========================================================================
+#========================== Fin de la fonction ==================================
+#
+#========================= Debut de la fonction ==================================
+#
def creation_dircase(num_tuto) :
"""
Creation of a directory for the results of tutorial_x
def creation_dircase(num_tuto) :
"""
Creation of a directory for the results of tutorial_x
@@
-110,7
+115,7
@@
num_tuto: number of the tutorial
Copyright EDF-R&D 2014
"""
#
Copyright EDF-R&D 2014
"""
#
- if
os.environ.has_key("LOGNAME")
:
+ if
"LOGNAME" in os.environ
:
user = os.environ ["LOGNAME"]
else :
user = "anonymous"
user = os.environ ["LOGNAME"]
else :
user = "anonymous"
@@
-124,6
+129,6
@@
Copyright EDF-R&D 2014
os.mkdir (dircase)
#
return dircase
os.mkdir (dircase)
#
return dircase
-#
========================================================================
-#==========================
============
==================================
+#
+#==========================
Fin de la fonction
==================================
#
#