Salome HOME
[PY3] 2to3 results
[modules/smesh.git] / src / Tools / YamsPlug / monYamsPlugDialog.py
index 058fee9aa3e9cf52dc6f8913ce1c4420746be535..90e4917971f0affb707c86f068f83f7d7abce4ec 100644 (file)
@@ -43,7 +43,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     self.num=1
     self.__selectedMesh=None
 
-    # complex whith QResources: not used
+    # complex with QResources: not used
     # The icon are supposed to be located in the $SMESH_ROOT_DIR/share/salome/resources/smesh folder,
     # other solution could be in the same folder than this python module file:
     # iconfolder=os.path.dirname(os.path.abspath(__file__))
@@ -178,7 +178,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     newLink=monStudyBuilder.NewObject(SOMesh)
     monStudyBuilder.Addreference(newLink, newStudyIter)
 
-    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(0)
+    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
     self.num+=1
     return True
 
@@ -223,7 +223,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     #myStudy.IsStudyLocked()
     myComponent = myStudy.FindComponent(name)
     if myComponent == None:
-      print "myComponent not found, create"
+      print("myComponent not found, create")
       myComponent = myBuilder.NewComponent(name)
     AName = myBuilder.FindOrCreateAttribute(myComponent, "AttributeName")
     AName.SetValue(name)
@@ -236,9 +236,9 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     ACmt = myBuilder.FindOrCreateAttribute(myObject, "AttributeComment")
     ACmt.SetValue(datai)
 
-    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(0)
+    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
     self.num += 1
-    if verbose: print("save %s in Object Browser done: %s\n%s" % (name, myObject.GetID(), datai))
+    if verbose: print(("save %s in Object Browser done: %s\n%s" % (name, myObject.GetID(), datai)))
     return True
 
   def PBSaveHypPressed(self):
@@ -273,9 +273,9 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     data = self.getResumeData(separator=" ; ")
     self.editor.setAttributeValue(newStudyIter, "AttributeComment", data)
     
-    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(0)
+    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
     self.num += 1
-    if verbose: print("save %s in Object Browser done:\n%s" % (name, data))
+    if verbose: print(("save %s in Object Browser done:\n%s" % (name, data)))
     return True
 
   def SP_toStr(self, widget):
@@ -413,7 +413,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     if fd.exec_():
       infile = fd.selectedFiles()[0]
       self.LE_MeshFile.setText(infile)
-      self.fichierIn=unicode(infile).encode("latin-1")
+      self.fichierIn=str(infile).encode("latin-1")
       self.MeshIn=""
       self.LE_MeshSmesh.setText("")
 
@@ -422,7 +422,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     if fd.exec_():
       infile = fd.selectedFiles()[0]
       self.LE_ParamsFile.setText(infile)
-      self.paramsFile=unicode(infile).encode("latin-1")
+      self.paramsFile=str(infile).encode("latin-1")
 
   def meshFileNameChanged(self):
     self.fichierIn=str(self.LE_MeshFile.text())
@@ -479,7 +479,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     self.fichierIn=""
 
   def prepareFichier(self):
-    self.fichierIn=tempfile.mktemp(suffix=".meshb",prefix="ForSurfOpt_")
+    self.fichierIn=tempfile.mktemp(suffix=".mesh",prefix="ForSurfOpt_")
     if os.path.exists(self.fichierIn):
         os.remove(self.fichierIn)
     self.__selectedMesh.ExportGMF(self.__selectedMesh, self.fichierIn, True)
@@ -504,7 +504,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
       except:
         pass
       
-    style = unicode(self.style).encode("latin-1")
+    style = str(self.style).encode("latin-1")
     # Translation of old Yams options to new MG-SurfOpt options
     if   style == "0" :
       self.commande+= " --optimisation only"
@@ -522,7 +522,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
       self.commande+= " -O G"  # This option has not been updated to the new option style yet
 
     deb=os.path.splitext(self.fichierIn)
-    self.fichierOut=deb[0] + "_output.meshb"
+    self.fichierOut=deb[0] + "_output.mesh"
     
     tolerance=self.SP_toStr(self.SP_Tolerance)
     if not self.RB_Absolute.isChecked():
@@ -543,7 +543,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
     self.commande+=" --in "  + self.fichierIn
     self.commande+=" --out " + self.fichierOut
     
-    print self.commande
+    print(self.commande)
     return True
 
   def clean(self):