From: PASCALE NOYRET Date: Mon, 30 May 2022 09:58:35 +0000 (+0200) Subject: enleve print intempestif X-Git-Tag: merge_uncertainty_odysee_1210~73 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=44ea060621543fdc97376cadec2bf98eac960ced;p=tools%2Feficas.git enleve print intempestif --- diff --git a/generator/generator_python.py b/generator/generator_python.py index 22399eeb..e48832cb 100644 --- a/generator/generator_python.py +++ b/generator/generator_python.py @@ -89,9 +89,11 @@ class PythonGenerator(object): self.appliEficas=None def writeFile(self,filename): - fp=open(filename,'w') - fp.write(self.text) - fp.close() + try : + with open(filename, "w") as fp: + fp.write(self.text) + return 1 + except : return 0 def gener(self,obj,format='brut',config=None,appliEficas=None): """ @@ -103,7 +105,7 @@ class PythonGenerator(object): """ import logging if obj == None : - print ('appel a gener avec None') + #print ('appel a gener avec None') return self.appliEficas=appliEficas liste= self.generator(obj)