-#!/usr/bin/env python
-# -*- coding: iso-8859-1 -*-
+#!/usr/bin/env python3
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
+#!/usr/bin/env python3
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-#!/usr/bin/env python
import unittest, sys, os
-#!/usr/bin/env python
-# -*- coding: iso-8859-1 -*-
+#!/usr/bin/env python3
# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
plugin_module_name = plugin_name + "Builder"
plugin_module = "salome.%s.%s" % (plugin_name, plugin_module_name)
try:
- exec( "from salome.smesh.smeshBuilder import *")
- exec( "import %s" % plugin_module )
- exec( "mod = %s" % plugin_module )
+ exec("from salome.smesh.smeshBuilder import *", globals())
+ exec("import %s" % plugin_module, globals())
+ exec("mod = %s" % plugin_module , globals())
methods = {}
for attr in dir( mod ):
if attr.startswith( '_' ): continue
if docHelper: break
pass
if not docHelper: docHelper = "Creates new algorithm."
- output.append( " ## %s" % docHelper )
- output.append( " #" )
- output.append( " # This method is dynamically added to %Mesh class by the meshing plug-in(s). " )
- output.append( " #" )
- output.append( " # If the optional @a geom_shape parameter is not set, this algorithm is global (applied to whole mesh)." )
- output.append( " # Otherwise, this algorithm defines a submesh based on @a geom_shape subshape." )
- output.append( " # @param algo_type type of algorithm to be created; allowed values are specified by classes implemented by plug-in (see below)" )
- output.append( " # @param geom_shape if defined, the subshape to be meshed (GEOM_Object)" )
- output.append( " # @return An instance of Mesh_Algorithm sub-class according to the specified @a algo_type, see " )
- output.append( " # %s" % ", ".join( [ "%s.%s" % ( plugin_module_name, algo.__name__ ) for algo in methods[ method ] ] ) )
- output.append( " def %s(algo_type, geom_shape=0):" % method )
- output.append( " pass" )
+ output.append( " ## %s" % docHelper )
+ output.append( " #" )
+ output.append( " # This method is dynamically added to %Mesh class by the meshing plug-in(s). " )
+ output.append( " #" )
+ output.append( " # If the optional @a geom_shape parameter is not set, this algorithm is global (applied to whole mesh)." )
+ output.append( " # Otherwise, this algorithm defines a submesh based on @a geom_shape subshape." )
+ output.append( " # @param algo_type type of algorithm to be created; allowed values are specified by classes implemented by plug-in (see below)" )
+ output.append( " # @param geom_shape if defined, the subshape to be meshed (GEOM_Object)" )
+ output.append( " # @return An instance of Mesh_Algorithm sub-class according to the specified @a algo_type, see " )
+ output.append( " # %s" % ", ".join( [ "%s.%s" % ( plugin_module_name, algo.__name__ ) for algo in methods[ method ] ] ) )
+ output.append( " def %s(algo_type, geom_shape=0):" % method )
+ output.append( " pass" )
pass
- f = open(output_file, "w")
- for line in output: f.write( line + "\n" )
- f.close()
+ with open(output_file, "w", encoding='utf8') as f:
+ f.write('\n'.join(output))
pass
pass
except Exception as e:
pass
if __name__ == "__main__":
- import optparse
- parser = optparse.OptionParser(usage="%prog [options] plugin")
+ import argparse
+ parser = argparse.ArgumentParser()
h = "Output file (smesh.py by default)"
- parser.add_option("-o", "--output", dest="output",
- action="store", default=None, metavar="file",
+ parser.add_argument("-o", "--output", dest="output",
+ action="store", default='smesh.py', metavar="file",
help=h)
h = "If this option is True, dummy help for Mesh class is added. "
h += "This option should be False (default) when building documentation for SMESH module "
h += "and True when building documentation for meshing plug-ins."
- parser.add_option("-d", "--dummy-mesh-help", dest="dummymeshhelp",
+ parser.add_argument("-d", "--dummy-mesh-help", dest="dummymeshhelp",
action="store_true", default=False,
help=h)
- (options, args) = parser.parse_args()
+ parser.add_argument("plugin", help='Name of plugin')
+ args = parser.parse_args()
- if len( args ) < 1: sys.exit("Plugin name is not specified")
- main( args[0], options.dummymeshhelp, options.output )
+ main( args.plugin, args.dummymeshhelp, args.output )
pass
-# -*- coding: utf-8 -*-
-
import os
import datetime
import sys
-from qtsalome import QSqlQuery
-from .tableMaillages import TableMaillages
-from .tableMailleurs import TableMailleurs
-from .tableMachines import TableMachines
-from .tableVersions import TableVersions
-from .tableGroupesRef import TableGroupesRef
-from .tableGroupes import TableGroupes
-from .tableMailles import TableMailles
-from .tableTailles import TableTailles
-from .tableRatios import TableRatios
-from .tableGroupeRatios import TableGroupeRatios
-from .tableGroupeTailles import TableGroupeTailles
-from .tablePerfs import TablePerfs
+from qtsalome import QSqlQuery, QSqlDatabase
+from Base.tableMaillages import TableMaillages
+from Base.tableMailleurs import TableMailleurs
+from Base.tableMachines import TableMachines
+from Base.tableVersions import TableVersions
+from Base.tableGroupesRef import TableGroupesRef
+from Base.tableGroupes import TableGroupes
+from Base.tableMailles import TableMailles
+from Base.tableTailles import TableTailles
+from Base.tableRatios import TableRatios
+from Base.tableGroupeRatios import TableGroupeRatios
+from Base.tableGroupeTailles import TableGroupeTailles
+from Base.tablePerfs import TablePerfs
from Stats.job import Job
from CreeDocuments.jobHtml import Document
-#!/usr/bin/env python
+#!/usr/bin/env python3
import sys,os
from .dataBase import Base
if __name__ == "__main__":
- from optparse import OptionParser
- p=OptionParser()
- p.add_option('-p',dest='partiel',action="store_true", default=False,help='export de machine, groupe, ratio Maille et Perf uniquement')
- p.add_option('-d',dest='database',default="../myMesh.db",help='nom de la database')
- options, args = p.parse_args()
+ from argparse import ArgumentParser
+ p=ArgumentParser()
+ p.add_argument('-p',dest='partiel',action="store_true", default=False,help='export de machine, groupe, ratio Maille et Perf uniquement')
+ p.add_argument('-d',dest='database',default="../myMesh.db",help='nom de la database')
+ args = p.parse_args()
- maBase=Base(options.database)
+ maBase=Base(args.database)
maBase.initialise()
- maBase.exportToCSV(options.partiel)
+ maBase.exportToCSV(args.partiel)
maBase.close()
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
+#!/usr/bin/env python3
-import sys
import os
-from .dataBase import Base
-
+from dataBase import Base
if __name__ == "__main__":
- from optparse import OptionParser
- p=OptionParser()
- p.add_option('-p',dest='partiel',action="store_true", default=False,help='import de machine, groupe, ratio Maille et Perf uniquement')
- p.add_option('-f',dest='force',action="store_true", default=False,help='ecrasement des valeurs dans la base par les valeurs dans les fichiers en cas de meme clef primaire')
- p.add_option('-d',dest='database',default="myMesh.db",help='nom de la database')
- options, args = p.parse_args()
- if len(args) != 1 :
- print("entrer SVP le nom de la directory ou sont rangees les fichiers a charger")
- exit()
- folder=args[0]
+ from argparse import ArgumentParser
+ p=ArgumentParser()
+ p.add_argument('-p',dest='partiel',action="store_true", default=False,help='import de machine, groupe, ratio Maille et Perf uniquement')
+ p.add_argument('-f',dest='force',action="store_true", default=False,help='ecrasement des valeurs dans la base par les valeurs dans les fichiers en cas de meme clef primaire')
+ p.add_argument('-d',dest='database',default="myMesh.db",help='nom de la database')
+ p.add_argument('folder', help='Repertoire ou sont ranges les fichiers a charger')
+ args = p.parse_args()
- if not(os.path.isdir(folder)):
- print(folder , " n existe pas")
+ if not(os.path.isdir(args.folder)):
+ print(args.folder , " n existe pas")
exit()
- maBase=Base(options.database)
+ maBase=Base(args.database)
maBase.create()
maBase.initialise()
- maBase.importFromCSV(folder,options.partiel,options.force)
+ maBase.importFromCSV(args.folder,args.partiel,args.force)
maBase.close()
maQuery=QSqlQuery()
maQuery.exec_(texteQuery)
nb=0
- while(next(maQuery)): nb=nb+1
+ while(maQuery.next()): nb=nb+1
return nb
maQuery=QSqlQuery()
maQuery.exec_(texteQuery)
asauver=0
- while(next(maQuery)):
+ while(maQuery.next()):
asauver=1
for i in range(len(self.FieldStringList)):
texteSauve+=str(maQuery.value(i).toString())+";"
from qtsalome import QSqlQuery
-from .tableDeBase import TableDeBase
+from Base.tableDeBase import TableDeBase
class TableGroupeRatios (TableDeBase):
def __init__(self):
query.exec_(texteQuery)
nb=0
val=0 # Valeur si l enregistrement n existe pas
- while (next(query)) :
+ while (query.next()) :
val=query.value(0).toFloat()[0]
nb=nb+1
if nb > 1 : print("Double valeur de Reference dans la table des mailles")
from qtsalome import QSqlQuery
-from .tableDeBase import TableDeBase
+from Base.tableDeBase import TableDeBase
class TableGroupeTailles (TableDeBase):
def __init__(self):
query.exec_(texteQuery)
nb=0
val=0 # Valeur si l enregistrement n existe pas
- while (next(query)) :
+ while (query.next()) :
val=query.value(0).toFloat()[0]
nb=nb+1
if nb > 1 : print("Double valeur de Reference dans la table des tailles")
from qtsalome import QSqlQuery
-from .tableDeBase import TableDeBase
+from Base.tableDeBase import TableDeBase
class TableGroupes (TableDeBase):
def __init__(self):
texteQuery +=' and idVersion = ' + str(idVersion)
texteQuery +=' and Entite ="' + str(typeMaille) + '";'
query.exec_(texteQuery)
- while (next(query)) :
+ while (query.next()) :
val=query.value(0).toInt()[0]
- while (next(query)) :
+ while (query.next()) :
print("plusieurs enregistrements dans groupe pour ", nomGroupe," ",str(idMaillage)," ",str(idVersion),"\n")
return val
texteQuery ="select distinct Entite from Groupes;"
query.exec_(texteQuery)
maListe=[]
- while (next(query)) :
+ while (query.next()) :
maListe.append(str(query.value(0).toString()))
return maListe
from qtsalome import QSqlQuery
-from .tableDeBase import TableDeBase
+from Base.tableDeBase import TableDeBase
class TableGroupesRef (TableDeBase):
def __init__(self):
texteQuery ='select NomGroupe from GroupesRef where idMaillage='+str(idMaillage) +";"
listeGroupes=[]
query.exec_(texteQuery)
- while (next(query)) :
+ while (query.next()) :
listeGroupes.append(str(query.value(0).toString()))
return listeGroupes
-from qtsalome import QSqlQuery
-from .tableDeBase import TableDeBase
import os
+from qtsalome import QSqlQuery
+from Base.tableDeBase import TableDeBase
class TableMachines (TableDeBase):
def __init__(self):
texteQuery ="select nomMachine from Machines where nomMachine ='" + machine +"' ;"
query.exec_(texteQuery)
nb=0
- while(next(query)):
+ while(query.next()):
nb=nb+1
nom=str(query.value(0).toString())
if nb != 1 : return 0, ""
from qtsalome import QSqlQuery
-from .tableDeBase import TableDeBase
+from Base.tableDeBase import TableDeBase
class TableMaillages (TableDeBase):
def __init__(self):
valeur=None
texteQuery ='select '+ nomChamp + ' from Maillages where id=' + str(idMaillage) + ";"
query.exec_(texteQuery)
- while (next(query)) :
+ while (query.next()) :
valeur=query.value(0).toInt()[0]
- while (next(query)) :
+ while (query.next()) :
print("plusieurs enregistrements dans Maillages pour ",str(idMaillage))
exit()
return valeur
maQuery=QSqlQuery()
maQuery.exec_(texteQuery)
nb=0
- while(next(maQuery)): nb=nb+1
+ while(maQuery.next()): nb=nb+1
return nb
def remplit(self):
texteQuery="select id, nomScript,medResultat from Maillages;"
maQuery.exec_(texteQuery)
listeMaillages=[]
- while(next(maQuery)):
+ while(maQuery.next()):
listeMaillages.append((maQuery.value(0).toInt()[0], maQuery.value(1).toString(), maQuery.value(2).toString()))
return listeMaillages
texteQuery="select id, nomScript,medResultat from Maillages where id = " + str(idM) +';'
maQuery.exec_(texteQuery)
maSize=0
- while(next(maQuery)):
+ while(maQuery.next()):
maSize+=1
newListeMaillages.append((maQuery.value(0).toInt()[0], maQuery.value(1).toString(), maQuery.value(2).toString()))
if maSize != 1 :
texteQuery="select id,nomMaillage,seuilCPU,seuilRatio,seuilTaille,seuilNbMaille from Maillages where id = "+ str(idMaillage) +" ;"
maQuery=QSqlQuery()
maQuery.exec_(texteQuery)
- while(next(maQuery)):
+ while(maQuery.next()):
l1 = maQuery.value(0).toInt()[0]
l2 = maQuery.value(1).toString()
l3 = maQuery.value(2).toInt()[0]
texteQuery="select id,nomMaillage from Maillages order by id;"
maQuery=QSqlQuery()
maQuery.exec_(texteQuery)
- while(next(maQuery)):
+ while(maQuery.next()):
maillagesIdListe.append( maQuery.value(0).toInt()[0])
maillagesNomListe.append( maQuery.value(1).toString())
return maillagesIdListe, maillagesNomListe
print(texteQuery)
print(maQuery.exec_(texteQuery))
maQuery.exec_(texteQuery)
- while(next(maQuery)):
+ while(maQuery.next()):
idMailleur = maQuery.value(0).toInt()[0]
return idMailleur
from qtsalome import QSqlQuery
-from .tableDeBase import TableDeBase
+from Base.tableDeBase import TableDeBase
class TableMailles (TableDeBase):
def __init__(self):
query.exec_(texteQuery)
nb=0
val=0 # Valeur si l enregistrement n existe pas
- while (next(query)) :
+ while (query.next()) :
val=query.value(0).toInt()[0]
nb=nb+1
if nb > 1 : print("Double valeur de Reference dans la table des mailles")
texteQuery ="select distinct Entite from Mailles;"
query.exec_(texteQuery)
maListe=[]
- while (next(query)) :
+ while (query.next()) :
maListe.append(str(query.value(0).toString()))
return maListe
from qtsalome import QSqlQuery
-from .tableDeBase import TableDeBase
+from Base.tableDeBase import TableDeBase
class TableMailleurs (TableDeBase):
def __init__(self):
maQuery=QSqlQuery()
maQuery.exec_(texteQuery)
nb=0
- while(next(maQuery)): nb=nb+1
+ while(maQuery.next()): nb=nb+1
return nb
def remplit(self):
texteQuery="select * from Mailleurs;"
maQuery=QSqlQuery()
maQuery.exec_(texteQuery)
- while(next(maQuery)):
+ while(maQuery.next()):
l1.append( maQuery.value(0).toInt()[0])
l2.append( maQuery.value(1).toString())
return l1,l2
texteQuery="select nomMailleur from Mailleurs where id = " + str(mailleurId) + " ;"
maQuery=QSqlQuery()
maQuery.exec_(texteQuery)
- while(next(maQuery)):
+ while(maQuery.next()):
mailleurName=maQuery.value(0).toString()
return mailleurName
from qtsalome import QSqlQuery
-from .tableDeBase import TableDeBase
+from Base.tableDeBase import TableDeBase
class TablePerfs (TableDeBase):
def __init__(self):
texteQuery +=" and Machine ='" + Machine + "';"
query.exec_(texteQuery)
cpu=None
- while (next(query)) :
+ while (query.next()) :
cpu=query.value(0).toInt()[0]
- while (next(query)) :
+ while (query.next()) :
print("plusieurs enregistrements dans perf pour ",str(idMaillage)," ",str(idVersion)," ",Machine)
if cpu==None :
print("pas d enregistrement dans perf pour ",str(idMaillage)," ",str(idVersion)," ",Machine)
from qtsalome import QSqlQuery
-from .tableDeBase import TableDeBase
+from Base.tableDeBase import TableDeBase
class TableRatios (TableDeBase):
def __init__(self):
query.exec_(texteQuery)
nb=0
val=0 # Valeur si l enregistrement n existe pas
- while (next(query)) :
+ while (query.next()) :
val=query.value(0).toFloat()[0]
nb=nb+1
if nb > 1 : print("Double valeur de Reference dans la table des mailles")
from qtsalome import QSqlQuery
-from .tableDeBase import TableDeBase
+from Base.tableDeBase import TableDeBase
class TableTailles (TableDeBase):
def __init__(self):
query.exec_(texteQuery)
nb=0
val=0 # Valeur si l enregistrement n existe pas
- while (next(query)) :
+ while (query.next()) :
val=query.value(0).toFloat()[0]
nb=nb+1
if nb > 1 : print("Double valeur de Reference dans la table des mailles")
from qtsalome import QSqlQuery
-from .tableDeBase import TableDeBase
+from Base.tableDeBase import TableDeBase
class TableVersions (TableDeBase):
def __init__(self):
texteQuery ="select id, nomVersion from Versions where nomVersion ='" + version +"' ;"
query.exec_(texteQuery)
nb=0
- while(next(query)):
+ while(query.next()):
nb=nb+1
id=query.value(0).toInt()[0]
nom=query.value(1).toString()
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
+#!/usr/bin/env python3
import sys
import os
def Chercheversion(salomePath):
home=os.environ['HOME']
- commande=os.path.abspath(os.path.join(home,salomePath,'runAppli'))
+ commande=os.path.abspath(os.path.join(home,salomePath,'salome'))
argus="--version"
p = subprocess.Popen([commande,argus], stdout=subprocess.PIPE)
(output, err) = p.communicate()
- version=' '.join(output.split())
+ version=' '.join(output.decode().split())
return version
-#!/usr/bin/env python
-# -*- coding: iso-8859-1 -*-
+#!/usr/bin/env python3
import string
import os
-dir=os.path.dirname(os.path.abspath(__file__))
-FichierEntete=os.path.join(dir,'templatesHtml/entete.html')
-FichierMaillageEntete=os.path.join(dir,'templatesHtml/maillageEntete.html')
-FichierJob=os.path.join(dir,'templatesHtml/job.html')
-FichierTableau=os.path.join(dir,'templatesHtml/tableau.html')
-FichierLigne=os.path.join(dir,'templatesHtml/ligne.html')
-FichierFinTableau=os.path.join(dir,'templatesHtml/tableauFin.html')
-FichierSansGroupe=os.path.join(dir,'templatesHtml/sansGroupe.html')
-FichierGroupeRatio=os.path.join(dir,'templatesHtml/groupeRatio.html')
-FichierGroupeTaille=os.path.join(dir,'templatesHtml/groupeTaille.html')
+adir=os.path.dirname(os.path.abspath(__file__))
+FichierEntete=os.path.join(adir,'templatesHtml/entete.html')
+FichierMaillageEntete=os.path.join(adir,'templatesHtml/maillageEntete.html')
+FichierJob=os.path.join(adir,'templatesHtml/job.html')
+FichierTableau=os.path.join(adir,'templatesHtml/tableau.html')
+FichierLigne=os.path.join(adir,'templatesHtml/ligne.html')
+FichierFinTableau=os.path.join(adir,'templatesHtml/tableauFin.html')
+FichierSansGroupe=os.path.join(adir,'templatesHtml/sansGroupe.html')
+FichierGroupeRatio=os.path.join(adir,'templatesHtml/groupeRatio.html')
+FichierGroupeTaille=os.path.join(adir,'templatesHtml/groupeTaille.html')
def compte_all(texte, subString):
start = trouve + len(subString)
def FormateTexte(texte,dico):
- for clef in list(dico.keys()):
+ for clef in dico:
texteARemplacer="%"+str(clef)+"%"
remplacement=dico[clef]
if texte.find(texteARemplacer) < 0 :
return texte
def CreeEntete(dico):
- texteIni=open(FichierEntete).read()
+ texteIni=open(FichierEntete, 'r', encoding='utf8').read()
texteRetour=FormateTexte(texteIni,dico)
return texteRetour
def CreeMaillage(dico):
- texteIni=open(FichierMaillageEntete).read()
+ texteIni=open(FichierMaillageEntete, 'r', encoding='utf8').read()
texteRetour=FormateTexte(texteIni,dico)
return texteRetour
def CreeJob(dico):
- texte=open(FichierJob).read()
+ texte=open(FichierJob, 'r', encoding='utf8').read()
texteRetour=FormateTexte(texte,dico)
return texteRetour
def CreeGroupeTaille(dico):
- texte=open(FichierGroupeTaille).read()
+ texte=open(FichierGroupeTaille, 'r', encoding='utf8').read()
texteRetour=FormateTexte(texte,dico)
return texteRetour
def CreeGroupeRatio(dico):
- texte=open(FichierGroupeRatio).read()
+ texte=open(FichierGroupeRatio, 'r', encoding='utf8').read()
texteRetour=FormateTexte(texte,dico)
return texteRetour
def CreeMailleOuGroupe(dico,nb):
- texteIni=open(FichierTableau).read()
+ texteIni=open(FichierTableau, 'r', encoding='utf8').read()
texteLigneIni=open(FichierLigne).read()
for i in range (2,nb+1) :
texteLigne=FormateLigne(texteLigneIni,i)
texteRetour=FormateTexte(texteIni,dico)
- finTexte=open(FichierFinTableau).read()
+ finTexte=open(FichierFinTableau, 'r', encoding='utf8').read()
texteFinal=texteRetour+finTexte
return texteFinal
def EcritFichier(texte,filename):
- fp=open(filename,'w')
- fp.write(texte)
- fp.close()
+ with open(filename,'w',encoding='utf8') as fp:
+ fp.write(texte)
class Document:
# Form implementation generated from reading ui file 'desFenetreChoix.ui'
#
-# Created: Thu Mar 27 11:25:15 2014
-# by: PyQt4 UI code generator 4.9.6
+# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
-from PyQt4 import QtCore, QtGui
-
-try:
- _fromUtf8 = QtCore.QString.fromUtf8
-except AttributeError:
- def _fromUtf8(s):
- return s
-
-try:
- _encoding = QtGui.QApplication.UnicodeUTF8
- def _translate(context, text, disambig):
- return QtGui.QApplication.translate(context, text, disambig, _encoding)
-except AttributeError:
- def _translate(context, text, disambig):
- return QtGui.QApplication.translate(context, text, disambig)
+from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Choix(object):
def setupUi(self, Choix):
- Choix.setObjectName(_fromUtf8("Choix"))
+ Choix.setObjectName("Choix")
Choix.resize(440, 708)
- self.gridLayout = QtGui.QGridLayout(Choix)
- self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
- self.buttonBox = QtGui.QDialogButtonBox(Choix)
+ self.gridLayout = QtWidgets.QGridLayout(Choix)
+ self.gridLayout.setObjectName("gridLayout")
+ self.buttonBox = QtWidgets.QDialogButtonBox(Choix)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
- self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
- self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
+ self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
+ self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 2, 0, 1, 1)
- self.groupBox = QtGui.QGroupBox(Choix)
- self.groupBox.setObjectName(_fromUtf8("groupBox"))
- self.layoutWidget = QtGui.QWidget(self.groupBox)
+ self.groupBox = QtWidgets.QGroupBox(Choix)
+ self.groupBox.setObjectName("groupBox")
+ self.layoutWidget = QtWidgets.QWidget(self.groupBox)
self.layoutWidget.setGeometry(QtCore.QRect(40, 310, 311, 269))
- self.layoutWidget.setObjectName(_fromUtf8("layoutWidget"))
- self.gridLayout_2 = QtGui.QGridLayout(self.layoutWidget)
- self.gridLayout_2.setMargin(0)
- self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
- self.PBMaille = QtGui.QPushButton(self.layoutWidget)
- self.PBMaille.setObjectName(_fromUtf8("PBMaille"))
+ self.layoutWidget.setObjectName("layoutWidget")
+ self.gridLayout_2 = QtWidgets.QGridLayout(self.layoutWidget)
+ self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
+ self.gridLayout_2.setObjectName("gridLayout_2")
+ self.PBMaille = QtWidgets.QPushButton(self.layoutWidget)
+ self.PBMaille.setObjectName("PBMaille")
self.gridLayout_2.addWidget(self.PBMaille, 1, 0, 1, 1)
- self.PBRatio = QtGui.QPushButton(self.layoutWidget)
- self.PBRatio.setObjectName(_fromUtf8("PBRatio"))
+ self.PBRatio = QtWidgets.QPushButton(self.layoutWidget)
+ self.PBRatio.setObjectName("PBRatio")
self.gridLayout_2.addWidget(self.PBRatio, 3, 0, 1, 1)
- self.PBPerf = QtGui.QPushButton(self.layoutWidget)
- self.PBPerf.setObjectName(_fromUtf8("PBPerf"))
+ self.PBPerf = QtWidgets.QPushButton(self.layoutWidget)
+ self.PBPerf.setObjectName("PBPerf")
self.gridLayout_2.addWidget(self.PBPerf, 7, 0, 1, 1)
- self.PBGroupeRatio = QtGui.QPushButton(self.layoutWidget)
- self.PBGroupeRatio.setObjectName(_fromUtf8("PBGroupeRatio"))
+ self.PBGroupeRatio = QtWidgets.QPushButton(self.layoutWidget)
+ self.PBGroupeRatio.setObjectName("PBGroupeRatio")
self.gridLayout_2.addWidget(self.PBGroupeRatio, 6, 0, 1, 1)
- self.PBGroupe = QtGui.QPushButton(self.layoutWidget)
- self.PBGroupe.setObjectName(_fromUtf8("PBGroupe"))
+ self.PBGroupe = QtWidgets.QPushButton(self.layoutWidget)
+ self.PBGroupe.setObjectName("PBGroupe")
self.gridLayout_2.addWidget(self.PBGroupe, 4, 0, 1, 1)
- self.PBTaille = QtGui.QPushButton(self.layoutWidget)
- self.PBTaille.setObjectName(_fromUtf8("PBTaille"))
+ self.PBTaille = QtWidgets.QPushButton(self.layoutWidget)
+ self.PBTaille.setObjectName("PBTaille")
self.gridLayout_2.addWidget(self.PBTaille, 2, 0, 1, 1)
- self.PBGroupeTaille = QtGui.QPushButton(self.layoutWidget)
- self.PBGroupeTaille.setObjectName(_fromUtf8("PBGroupeTaille"))
+ self.PBGroupeTaille = QtWidgets.QPushButton(self.layoutWidget)
+ self.PBGroupeTaille.setObjectName("PBGroupeTaille")
self.gridLayout_2.addWidget(self.PBGroupeTaille, 5, 0, 1, 1)
- self.layoutWidget1 = QtGui.QWidget(self.groupBox)
+ self.layoutWidget1 = QtWidgets.QWidget(self.groupBox)
self.layoutWidget1.setGeometry(QtCore.QRect(40, 50, 301, 211))
- self.layoutWidget1.setObjectName(_fromUtf8("layoutWidget1"))
- self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget1)
- self.verticalLayout.setMargin(0)
- self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
- self.PBMailleur = QtGui.QPushButton(self.layoutWidget1)
- self.PBMailleur.setObjectName(_fromUtf8("PBMailleur"))
+ self.layoutWidget1.setObjectName("layoutWidget1")
+ self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget1)
+ self.verticalLayout.setContentsMargins(0, 0, 0, 0)
+ self.verticalLayout.setObjectName("verticalLayout")
+ self.PBMailleur = QtWidgets.QPushButton(self.layoutWidget1)
+ self.PBMailleur.setObjectName("PBMailleur")
self.verticalLayout.addWidget(self.PBMailleur)
- self.PBMaillage = QtGui.QPushButton(self.layoutWidget1)
- self.PBMaillage.setObjectName(_fromUtf8("PBMaillage"))
+ self.PBMaillage = QtWidgets.QPushButton(self.layoutWidget1)
+ self.PBMaillage.setObjectName("PBMaillage")
self.verticalLayout.addWidget(self.PBMaillage)
- self.PBMachine = QtGui.QPushButton(self.layoutWidget1)
- self.PBMachine.setObjectName(_fromUtf8("PBMachine"))
+ self.PBMachine = QtWidgets.QPushButton(self.layoutWidget1)
+ self.PBMachine.setObjectName("PBMachine")
self.verticalLayout.addWidget(self.PBMachine)
- self.PBVersion = QtGui.QPushButton(self.layoutWidget1)
- self.PBVersion.setObjectName(_fromUtf8("PBVersion"))
+ self.PBVersion = QtWidgets.QPushButton(self.layoutWidget1)
+ self.PBVersion.setObjectName("PBVersion")
self.verticalLayout.addWidget(self.PBVersion)
- self.PBGroupesRef = QtGui.QPushButton(self.layoutWidget1)
- self.PBGroupesRef.setObjectName(_fromUtf8("PBGroupesRef"))
+ self.PBGroupesRef = QtWidgets.QPushButton(self.layoutWidget1)
+ self.PBGroupesRef.setObjectName("PBGroupesRef")
self.verticalLayout.addWidget(self.PBGroupesRef)
self.gridLayout.addWidget(self.groupBox, 1, 0, 1, 1)
self.retranslateUi(Choix)
- QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Choix.accept)
- QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Choix.reject)
+ self.buttonBox.accepted.connect(Choix.accept)
+ self.buttonBox.rejected.connect(Choix.reject)
QtCore.QMetaObject.connectSlotsByName(Choix)
def retranslateUi(self, Choix):
- Choix.setWindowTitle(_translate("Choix", "Verification de Maillage", None))
- self.groupBox.setTitle(_translate("Choix", "Tables ", None))
- self.PBMaille.setText(_translate("Choix", "Table Mailles", None))
- self.PBRatio.setText(_translate("Choix", "Table Ratios", None))
- self.PBPerf.setText(_translate("Choix", "Table Performances", None))
- self.PBGroupeRatio.setText(_translate("Choix", "Table Groupe Ratios", None))
- self.PBGroupe.setText(_translate("Choix", "Table Groupes", None))
- self.PBTaille.setText(_translate("Choix", "Table Tailles", None))
- self.PBGroupeTaille.setText(_translate("Choix", "Table Groupe Tailles", None))
- self.PBMailleur.setText(_translate("Choix", "Table Mailleurs", None))
- self.PBMaillage.setText(_translate("Choix", "Table Maillages", None))
- self.PBMachine.setText(_translate("Choix", "Table Machines", None))
- self.PBVersion.setText(_translate("Choix", "Table Versions", None))
- self.PBGroupesRef.setText(_translate("Choix", "Table Groupes Référence", None))
+ _translate = QtCore.QCoreApplication.translate
+ Choix.setWindowTitle(_translate("Choix", "Verification de Maillage"))
+ self.groupBox.setTitle(_translate("Choix", "Tables "))
+ self.PBMaille.setText(_translate("Choix", "Table Mailles"))
+ self.PBRatio.setText(_translate("Choix", "Table Ratios"))
+ self.PBPerf.setText(_translate("Choix", "Table Performances"))
+ self.PBGroupeRatio.setText(_translate("Choix", "Table Groupe Ratios"))
+ self.PBGroupe.setText(_translate("Choix", "Table Groupes"))
+ self.PBTaille.setText(_translate("Choix", "Table Tailles"))
+ self.PBGroupeTaille.setText(_translate("Choix", "Table Groupe Tailles"))
+ self.PBMailleur.setText(_translate("Choix", "Table Mailleurs"))
+ self.PBMaillage.setText(_translate("Choix", "Table Maillages"))
+ self.PBMachine.setText(_translate("Choix", "Table Machines"))
+ self.PBVersion.setText(_translate("Choix", "Table Versions"))
+ self.PBGroupesRef.setText(_translate("Choix", "Table Groupes Référence"))
if __name__ == "__main__":
import sys
- app = QtGui.QApplication(sys.argv)
- Choix = QtGui.QDialog()
+ app = QtWidgets.QApplication(sys.argv)
+ Choix = QtWidgets.QDialog()
ui = Ui_Choix()
ui.setupUi(Choix)
Choix.show()
-from desFenetreChoix_ui import Ui_Choix
from qtsalome import *
+from .desFenetreChoix import Ui_Choix
from .monEditor import TableEditor
# Import des panels
quitButton=QPushButton("Quit")
buttonBox=QDialogButtonBox(Qt.Vertical)
buttonBox.addButton(quitButton, QDialogButtonBox.RejectRole);
- quitButton.clicked.connect(self.close())
+ quitButton.clicked.connect(self.close)
mainLayout = QHBoxLayout(self)
mainLayout.addWidget(self.view)
self.view.adjustSize()
self.adjustSize()
self.view.pressed[QModelIndex].connect(self.donneLigne)
- self.view.itemPressed[QTableWidgetItem].conect(self.donneLigne)
+ self.view.itemPressed[QTableWidgetItem].connect(self.donneLigne)
self.view.clicked[QModelIndex].connect(self.donneLigne)
self.view.clicked.connect(self.donneLigne)
self.view.pressed.connect(self.donneLigne)
-#!/usr/bin/env python
+#!/usr/bin/env python3
import sys,os
rep=os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0,installDir)
from qtsalome import QApplication
-from Gui.maFenetreChoix_ui import MaFenetreChoix
+from Gui.maFenetreChoix import MaFenetreChoix
from Base.dataBase import Base
if __name__ == "__main__":
- from optparse import OptionParser
- p=OptionParser()
- p.add_option('-d',dest='database',default="myMesh.db",help='nom de la database')
- options, args = p.parse_args()
+ from argparse import ArgumentParser
+ p=ArgumentParser()
+ p.add_argument('-d',dest='database',default="myMesh.db",help='nom de la database')
+ args = p.parse_args()
app = QApplication(sys.argv)
- maBase=Base(options.database)
+ maBase=Base(args.database)
maBase.initialise()
window = MaFenetreChoix(maBase)
window.show()
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
+#!/usr/bin/env python3
import sys,os
import salome
def execute(self):
home=os.environ['HOME']
- commande=os.path.abspath(os.path.join(home,self.salomePath,"runAppli"))
+ commande=os.path.abspath(os.path.join(home,self.salomePath,"salome"))
script= os.path.abspath(os.path.join(os.path.abspath(__file__),'../..',self.script))
debut=time.time()
-#!/usr/bin/env python
+#!/usr/bin/env python3
import sys, os
rep=os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0,installDir)
from qtsalome import *
-from .Base.dataBase import Base
+from Base.dataBase import Base
def completeDatabase(fichier,table,enregistrement):
maBase=Base(fichier)
if __name__ == "__main__":
- from optparse import OptionParser
- p=OptionParser()
- p.add_option('-d',dest='database',default="myMesh.db",help='nom de la database')
- p.add_option('-t',dest='table',help='nom de la table a completer')
- options, args = p.parse_args()
- if options.table==None :
+ from argparse import ArgumentParser
+ p=ArgumentParser()
+ p.add_argument('-d',dest='database',default="myMesh.db",help='nom de la database')
+ p.add_argument('table',help='nom de la table a completer')
+ p.add_argument('enregistrement', nargs="+")
+ args = p.parse_args()
+ if args.table is None :
print("table obligatoire")
exit()
- if options.table not in ("TableMaillages","TableMailleurs","TableGroupesRef","TableVersions") :
- print("la table doit etre : TableMaillages ou TableMailleurs ou TableGroupesRef ou TableVersions")
+ good_tables = ("TableMaillages","TableMailleurs","TableGroupesRef","TableVersions")
+ if args.table not in good_tables:
+ print("la table doit etre : %s" % ' ou '.join(good_tables))
exit()
- enregistrement=tuple(args)
- completeDatabase(options.database,options.table,enregistrement)
+ completeDatabase(args.database,args.table,args.enregistrement)
import sys
import os
-from .Base.dataBase import Base
-from .Base.versions import Chercheversion
+from Base.dataBase import Base
+from Base.versions import Chercheversion
if __name__ == "__main__":
- from optparse import OptionParser
- p=OptionParser()
- p.add_option('-s',dest='salomePath',help='chemin du runAppli de la version a comparer',default="Appli")
- p.add_option('-v',dest='version',help='id de la version a comparer',default=None)
- p.add_option('-r',dest='versionRef',help='liste des id des versions de reference',default=None)
- p.add_option('-d',dest='database',default="myMesh.db",help='nom de la database')
- p.add_option('-f',dest='fileHtml',default="/tmp/toto.htm",help='nom du fichier produit')
- options, args = p.parse_args()
+ from argparse import ArgumentParser
+ p=ArgumentParser()
+ p.add_argument('-s',dest='salomePath',help='chemin du lanceur salome de la version a comparer',default="Appli")
+ p.add_argument('-v',dest='version',help='id de la version a comparer',default=None)
+ p.add_argument('-r',dest='versionRef',help='liste des id des versions de reference',default=None)
+ p.add_argument('-d',dest='database',default="myMesh.db",help='nom de la database')
+ p.add_argument('-f',dest='fileHtml',default="/tmp/toto.htm",help='nom du fichier produit')
+ args = p.parse_args()
- if options.version==None :
- options.version=Chercheversion(options.salomePath)
+ if args.version is None :
+ args.version=Chercheversion(args.salomePath)
exit
- maBase=Base(options.database)
+ maBase=Base(args.database)
maBase.initialise()
- maBase.compare(options.version,options.versionRef,options.fileHtml)
+ maBase.compare(args.version,args.versionRef,args.fileHtml)
maBase.close()
#!/usr/bin/env python
import sys
-from .Base.dataBase import Base
+from Base.dataBase import Base
def creeDatabase(fichier):
maBase=Base(fichier)
if __name__ == "__main__":
- from optparse import OptionParser
- p=OptionParser()
- p.add_option('-d',dest='database',default="myMesh.db",help='nom de la database')
- options, args = p.parse_args()
- creeDatabase(options.database )
+ from argparse import ArgumentParser
+ p=ArgumentParser()
+ p.add_argument('-d',dest='database',default="myMesh.db",help='nom de la database')
+ args = p.parse_args()
+ creeDatabase(args.database )
-#!/usr/bin/env python
+#!/usr/bin/env python3
from qtsalome import *
from .Gui.myMain_ui import Ui_Gestion
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
+#!/usr/bin/env python3
import sys
import os
-from .Base.dataBase import Base
-from .Base.versions import Chercheversion
+from Base.dataBase import Base
+from Base.versions import Chercheversion
if __name__ == "__main__":
- from optparse import OptionParser
- p=OptionParser()
- p.add_option('-a',dest='all',action="store_true", default=False,help='passe l ensemble des Tests')
- p.add_option('-s',dest='salomePath',help='chemin du runAppli',default="Appli")
- p.add_option('-v',dest='version',help='id de la version')
- p.add_option('-d',dest='database',default="myMesh.db",help='nom de la database')
- p.add_option('-f',dest='force',default=True,help='force la passage des jobs meme si l execution a deja eu lieu sur cette machine pour cette version de salome')
- options, args = p.parse_args()
- if len(args) == 0 and options.all== False:
+ from argparse import ArgumentParser
+ p=ArgumentParser()
+ p.add_argument('-a',dest='all_tests',action="store_true", default=False,help='passe l ensemble des Tests')
+ p.add_argument('-s',dest='salomePath',help='chemin du lanceur salome',default="Appli")
+ p.add_argument('-v',dest='version',help='id de la version')
+ p.add_argument('-d',dest='database',default="myMesh.db",help='nom de la database')
+ p.add_argument('-f',dest='force',default=True,help='force la passage des jobs meme si l execution a deja eu lieu sur cette machine pour cette version de salome')
+ p.add_argument('job', nargs='*')
+ args = p.parse_args()
+ if len(args.job) == 0 and args.all_tests == False:
print("Enter -a ou un numero de job")
print(2)
exit()
- if options.salomePath==None :
- print("chemin du runAppli obligatoire")
+ if args.salomePath is None :
+ print("chemin du lanceur salome obligatoire")
exit()
- if options.version==None :
- options.version=Chercheversion(options.salomePath)
- maBase=Base(options.database)
+ if args.version is None :
+ args.version=Chercheversion(args.salomePath)
+ maBase=Base(args.database)
maBase.initialise()
- maBase.passeJobs(options.all,options.salomePath,options.version,options.force,args)
+ maBase.passeJobs(args.all_tests,args.salomePath,args.version,args.force,args.job)
maBase.close()
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
+#!/usr/bin/env python3
import Zcracks
Zcracks.IHM()
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright (C) 2011-2016 EDF R&D
#
# This library is free software; you can redistribute it and/or
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+import csv
import salome
salome.salome_init()
import GEOM
geompy = geomBuilder.New(salome.myStudy)
filename="/home/gboulant/development/projets/salome/SPADDER/spadder/resources/padderexe/REF_spheres.dat.xyz"
-file=open(filename,'rb')
-import csv
-datalines = csv.reader(file, delimiter=' ')
+with open(filename,'rb') as f:
+ datalines = csv.reader(file, delimiter=' ')
i=0
for row in datalines:
x=float(row[0])