Salome HOME
PN bug notation scientifique
[tools/eficas.git] / Editeur / utils.py
index f186acbcef90abff0335234199e70053dbbfb2b2..a9670ddc4610de42d8f9aa0e7ad9d6bd895b4f75 100644 (file)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 #            CONFIGURATION MANAGEMENT OF EDF VERSION
 # ======================================================================
 # COPYRIGHT (C) 1991 - 2002  EDF R&D                  WWW.CODE-ASTER.ORG
@@ -23,6 +24,7 @@
 import os,re
 import glob
 import traceback
+import codecs,types
 
 def substract_list(liste1,liste2):
   """ 
@@ -83,12 +85,12 @@ def save_in_file(file,text):
       retourne 1 si OK 0 sinon
   """
   try :
-    f=open(file,'w+')
-    f.write(text)
-    f.close()
-    return 1
+      f=open(file,'w')
+      f.write(text)
+      f.close()
+      return 1
   except:
-    return 0
+      return 0
 
 def extension_fichier(pathAndFile):
     """ Return ext if path/filename.ext is given """