import os,re
import glob
import traceback
-import codecs
+import codecs,types
def substract_list(liste1,liste2):
"""
retourne 1 si OK 0 sinon
"""
try :
- f=codecs.open(file,'w','iso-8859-1')
- f.write(text)
- f.close()
- return 1
+ if type(text) == types.StringType:
+ f=open(file,'w')
+ else:
+ # Probablement Unicode
+ f=codecs.open(file,'w','iso-8859-1')
+ f.write(text)
+ f.close()
+ return 1
except:
- return 0
+ return 0
def extension_fichier(pathAndFile):
""" Return ext if path/filename.ext is given """