X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FTools%2FVerima%2FBase%2FtableMaillages.py;h=60d40e43d74e7703e1717d2074e571c284510eaf;hp=dccad9382acaad59114c3b7d0ffb791dbe61dd21;hb=0fc0831670e27a5611b941c52dc152fd63964515;hpb=0003e6b4fcc95a0aec695ceef8371dee28baf417 diff --git a/src/Tools/Verima/Base/tableMaillages.py b/src/Tools/Verima/Base/tableMaillages.py index dccad9382..60d40e43d 100644 --- a/src/Tools/Verima/Base/tableMaillages.py +++ b/src/Tools/Verima/Base/tableMaillages.py @@ -1,5 +1,24 @@ +# Copyright (C) 2013-2020 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + from qtsalome import QSqlQuery -from .tableDeBase import TableDeBase +from Base.tableDeBase import TableDeBase class TableMaillages (TableDeBase): def __init__(self): @@ -21,9 +40,9 @@ class TableMaillages (TableDeBase): 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 @@ -33,7 +52,7 @@ class TableMaillages (TableDeBase): maQuery=QSqlQuery() maQuery.exec_(texteQuery) nb=0 - while(next(maQuery)): nb=nb+1 + while(maQuery.next()): nb=nb+1 return nb def remplit(self): @@ -48,7 +67,7 @@ class TableMaillages (TableDeBase): 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 @@ -59,7 +78,7 @@ class TableMaillages (TableDeBase): 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 : @@ -70,7 +89,7 @@ class TableMaillages (TableDeBase): 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] @@ -84,7 +103,7 @@ class TableMaillages (TableDeBase): 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 @@ -95,6 +114,6 @@ class TableMaillages (TableDeBase): print(texteQuery) print(maQuery.exec_(texteQuery)) maQuery.exec_(texteQuery) - while(next(maQuery)): + while(maQuery.next()): idMailleur = maQuery.value(0).toInt()[0] return idMailleur