]> SALOME platform Git repositories - tools/eficas.git/commitdiff
Salome HOME
Fixed bug in OpenTURNS save methods
authorRenaud Barate <renaud.barate@edf.fr>
Fri, 14 Jan 2011 09:52:02 +0000 (09:52 +0000)
committerRenaud Barate <renaud.barate@edf.fr>
Fri, 14 Jan 2011 09:52:02 +0000 (09:52 +0000)
InterfaceQT4/editor.py
generator/generator_openturns_study.py
generator/generator_openturns_wrapper.py

index 233ca18b13edb4ce67d85985295a413b0275111d..77cb5fc966d56e47b3be6a73979d46f468b50f42 100644 (file)
@@ -661,11 +661,8 @@ class JDCEditor(QSplitter):
            self.tree.racine.item.getObject().nom=os.path.basename(newName)
            self.tree.racine.update_node_label()
                
-        if self.jdc.isvalid() != 0 :
-           try:
-              self.generator.writeDefault(fn)
-           except:
-              pass
+        if self.jdc.isvalid() != 0 and hasattr(self.generator, "writeDefault"):
+            self.generator.writeDefault(fn)
 
         if self.salome : 
                self.appliEficas.addJdcInSalome( self.fichier)
index 6f2312a13f56bc1bb256200352d6fe38203a2dbe..9a2854dc460fdf8054d58fad94754bb2c1e3c30c 100644 (file)
@@ -127,7 +127,7 @@ class OpenturnsGenerator(PythonGenerator):
 
    def writeDefault(self, fn):
       fileSTD = fn[:fn.rfind(".")] + '.py'
-      f = open( str(filename), 'wb')
+      f = open( str(fileSTD), 'wb')
       f.write( self.texteSTD )
       f.close()
 
index 2dfd61ad0508caffb6c20a10b23b29e7213715a8..8c1c94b4d10e96cf954380106690f5d05cb6eeba 100644 (file)
@@ -137,6 +137,5 @@ class OpenturnsGenerator(PythonGenerator):
          self.wrapperXML=None
 
    def writeDefault(self, filename):
-      fileXML = fn[:fn.rfind(".")] + '.xml'
-      self.wrapperXML.writeFile( fileXML )
-
+      fileXML = filename[:filename.rfind(".")] + '.xml'
+      self.wrapperXML.writeFile( str(fileXML) )