From 44ea060621543fdc97376cadec2bf98eac960ced Mon Sep 17 00:00:00 2001 From: PASCALE NOYRET Date: Mon, 30 May 2022 11:58:35 +0200 Subject: [PATCH] enleve print intempestif --- generator/generator_python.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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) -- 2.39.2