# Gestion des listes
else :
+ if maDefinition.intoSug != [] and maDefinition.intoSug != None:
+ from .monWidgetIntoSug import MonWidgetIntoSug
+ widget=MonWidgetIntoSug(self,maDefinition,monNom,monObjet,parentQt,maCommande)
#if maDefinition.into != [] and maDefinition.into != None:
# Attention pas fini --> on attend une liste de ASSD avec ordre
- if self.item.wait_assd() and self.item.is_list_SansOrdreNiDoublon():
+ elif self.item.wait_assd() and self.item.is_list_SansOrdreNiDoublon():
#if self.item.is_list_Chargement():
#from monWidgetPlusieursTuple2AvecChargement import MonWidgetPlusieursTuple2AvecChargement
#widget=MonWidgetPlusieursTuple2(self,maDefinition,monNom,monObjet,parentQt,maCommande)
has_an_into= self.definition.validators.has_into()
return has_an_into
+ def has_intoSug(self):
+ if self.definition.intoSug: return 1
+ return 0
+
def GetMinMax(self):
""" Retourne les valeurs min et max de la definition de object """
#print listevalideliste
return listevalideliste
+ def get_liste_possible_avecSug(self,listeActuelle=[]):
+ if hasattr(self.definition,'intoSug'):
+ valeurspossibles = self.definition.intoSug
+ else:
+ return listeActuelle
+
+ if listeActuelle==[] : return valeurspossibles
+ valeurspossibles = valeurspossibles+listeActuelle
+
+ #On ne garde que les items valides
+ listevalideitem=[]
+ if type(valeurspossibles) in (list,tuple) :
+ pass
+ else :
+ valeurspossibles=(valeurspossibles,)
+ for item in valeurspossibles:
+ encorevalide=self.valide_item(item)
+ if encorevalide :
+ listevalideitem.append(item)
+
+ #on ne garde que les choix possibles qui passent le test de valide_liste_partielle
+ listevalideliste=[]
+ for item in listevalideitem:
+ encorevalide=self.valide_liste_partielle(item,listeActuelle)
+ if encorevalide :
+ listevalideliste.append(item)
+ return listevalideliste
+
def get_liste_param_possible(self):
liste_param=[]
l1,l2=self.jdc.get_parametres_fonctions_avant_etape(self.get_etape())
self.fileInfo = QFileInfo(self.fichier)
self.fileInfo.setCaching(0)
if jdc==None :
- #try :
+ try :
self.jdc = self.readFile(self.fichier)
- #except :
- # print ("mauvaise lecture")
+ except :
+ print ("mauvaise lecture")
else :
self.jdc=jdc
if self.jdc is not None and units is not None:
#return self.get_Dico()
+ #-------------------# Pour execution avec output et error dans le bash
+ def process_VP(self):
+ #-------------------#
+ if 'dicoImbrique' in generator.plugins:
+ self.generator=generator.plugins['dicoImbrique']()
+ jdc_formate=self.generator.gener(self.jdc)
+ dico=self.get_Dico() #generator.Dico
+ return dico
+
+
#--------------------------------#
def ajoutCommentaire(self):
#--------------------------------#
tr("Copie impossible"),
tr("Veuillez selectionner un seul objet : la copie se fera apres le noeud selectionne"))
return
+ noeudOuColler=self.node_selected[0]
if len(self.QWParent.noeud_a_editer)!=1:
- self.handleEditPasteMultiple()
+ #self.handleEditPasteMultiple()
+ QMessageBox.information( self, tr("Copie impossible"), tr("Aucun Objet n a ete copie ou coupe"))
return
- noeudOuColler=self.node_selected[0]
- pos='after'
- if noeudOuColler == self.tree.racine:
- indexNoeudOuColler=0
- pos='before'
- else :
- indexNoeudOuColler=noeudOuColler.treeParent.children.index(noeudOuColler)
- indexNoeudOuColler=self.getTreeIndex(noeudOuColler)
-
- try :
- noeudACopier=self.QWParent.noeud_a_editer[0]
- indexNoeudACopier=noeudACopier.treeParent.children.index(noeudACopier)
- indexNoeudACopier=self.getTreeIndex(noeudACopier)
- except :
- QMessageBox.information( self, tr("Copie impossible"), tr("Aucun Objet n a ete copie ou coupe"))
- return
+ noeudACopier=self.QWParent.noeud_a_editer[0]
if (self.QWParent.edit != "couper"):
+ #print (noeudOuColler.item.parent.get_child(noeudOuColler.item.nom))
try:
if noeudOuColler == self.tree.racine :
child=noeudOuColler.doPastePremier(noeudACopier)
else :
- child=noeudACopier.doPaste(noeudOuColler,pos)
+ child=noeudACopier.doPaste(noeudOuColler,'after')
+
if child==None or child==0:
QMessageBox.critical( self,tr( "Copie refusee"),tr('Eficas n a pas reussi a copier l objet'))
self.message = ''
# si possible on renomme l objet comme le noeud couper
if (self.QWParent.edit == "couper"):
+ print ('je pass la')
if noeudACopier.treeParent.editor != noeudOuColler.treeParent.editor:
QMessageBox.critical( self, tr("Deplacement refuse"),tr('Deplacement refuse entre 2 fichiers. Seule la copie est autorisee '))
try :
jdc_formate=self.generator.gener(self.jdc,format=formatLigne,config=self.appliEficas.CONFIGURATION,appli=self.appliEficas)
if pourRun : jdc_formate=self.generator.textePourRun
+ if self.code == 'TELEMAC' : jdc_formate=self.generator.texteDico
except ValueError as e:
QMessageBox.critical(self, tr("Erreur a la generation"),str(e))
return
monMC.state='changed'
monMC.isvalid()
+ #-------------------------------------#
+ def getValeur(self,nomEtape,MCFils,listeAvant=()):
+ #-------------------------------------#
+
+ ouChercher=None
+ for e in self.jdc.etapes:
+ if e.nom == nomEtape : ouChercher=e; break
+ if ouChercher==None : return None
+ for mot in listeAvant :
+ ouChercher=ouChercher.get_child(mot,restreint="oui")
+ if ouChercher==None : return None
+ print ('apres', ouChercher)
+ monMC=ouChercher.get_child(MCFils,restreint="oui")
+ if monMC== None : return None
+ return monMC.valeur
+
#-----------------------------------------------------------#
def changeIntoMC(self,etape,MCFils,valeurs, listeAvant=()):
#-----------------------------------------------------------#
ouChercher=etape
+ if isinstance (etape, str):
+ ouChercher=None
+ for e in self.jdc.etapes:
+ if e.nom == etape : ouChercher=e; break
+ if ouChercher==None : return
+
for mot in listeAvant :
ouChercher=ouChercher.get_child(mot,restreint="oui")
- if ouChercher ==None : print ('SOUCI'); return
+ if ouChercher==None : return
monMC=ouChercher.get_child(MCFils,restreint="oui")
if monMC== None : monMC= ouChercher.addentite(MCFils)
monMC.state='changed'
return 1
-
#-------------------------------------#
- def changeIntoDefMC(self,etape,listeMC,valeurs):
+ def changeDefautDefMC(self,nomEtape,listeMC,valeurs):
#-------------------------------------#
+
+ #if isinstance (etape, str):
+ # for e in self.jdc.etapes:
+ # if e.nom == etape : etape=e; break
+ #if etape == None : return
definitionEtape=getattr(self.jdc.cata[0],etape)
ouChercher=definitionEtape
if len(listeMC) > 1 :
mcfact=ouChercher.entites[mc]
ouChercher=mcfact
+ print (ouChercher)
+ mcAccas=ouChercher.entites[listeMC[-1]]
+ mcAccas.defaut=valeurs
+ print (mcAccas.defaut)
+ return 1
+
+ #------------------------------------------------#
+ def changeIntoDefMC(self,nomEtape,listeMC,valeurs):
+ #------------------------------------------------#
+ definitionEtape=getattr(self.jdc.cata[0],nomEtape)
+ ouChercher=definitionEtape
+
+ if len(listeMC) > 1 :
+ for mc in listeMC[0:-1]:
+ mcfact=ouChercher.entites[mc]
+ ouChercher=mcfact
mcAccas=ouChercher.entites[listeMC[-1]]
if hasattr(mcAccas,'into') : oldValeurs=mcAccas.into
def deleteDefinitionMC(self,etape,listeAvant,nomDuMC):
#-------------------------------------------------------------#
#print 'in deleteDefinitionMC', etape,listeAvant,nomDuMC
+ if isinstance (etape, str):
+ for e in self.jdc.etapes:
+ if e.nom == etape : etape=e; break
+ if etape == None : return
definitionEtape=getattr(self.jdc.cata[0],etape)
ouChercher=definitionEtape
for k in listeAvant :
#-------------------------------------------------------------#
def ajoutDefinitionMC(self,etape,listeAvant,nomDuMC,typ,**args):
#-------------------------------------------------------------#
+ if isinstance (etape, str):
+ for e in self.jdc.etapes:
+ if e.nom == etape : etape=e; break
+ if etape == None : return
definitionEtape=getattr(self.jdc.cata[0],etape)
ouChercher=definitionEtape
for k in listeAvant :
#print self.dicoNouveauxMC
#----------------------------------------------------#
- def changeIntoMCandSet(self,etape,MCFils,into,valeurs):
+ def changeIntoMCandSet(self,etape,listeMC,into,valeurs):
#----------------------------------------------------#
- monMC=etape.get_child(MCFils,restreint="oui")
+
+ self.changeIntoDefMC(etape,listeMC,into)
+
+ if isinstance (etape, str):
+ for e in self.jdc.etapes:
+ if e.nom == etape : etape=e; break
+ if etape == None : return
+
+ ouChercher = etape
+ for mot in listeMC[:-1] :
+ ouChercher=ouChercher.get_child(mot,restreint="oui")
+ if ouChercher==None : return
+ MCFils=listeMC[-1]
+ print (MCFils)
+ monMC=ouChercher.get_child(MCFils,restreint="oui")
if monMC== None : monMC= etape.addentite(MCFils)
+ print (monMC)
+
monMC.definition.into=into
monMC.valeur=valeurs
monMC.val=valeurs
--- /dev/null
+# -*- coding: utf-8 -*-
+# Copyright (C) 2007-2013 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.
+#
+# 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
+#
+# Modules Python
+from __future__ import absolute_import
+try :
+ from builtins import str
+ from builtins import range
+except : pass
+
+import types,os
+
+# Modules Eficas
+from six.moves import range
+from PyQt5.QtWidgets import QCheckBox, QScrollBar, QFrame, QApplication, QLabel
+from PyQt5.QtWidgets import QSizePolicy,QSpacerItem
+from PyQt5.QtGui import QPalette, QFont
+from PyQt5.QtCore import Qt
+
+from Extensions.i18n import tr
+
+from desWidgetIntoSug import Ui_WidgetIntoSug
+from monWidgetPlusieursInto import MonWidgetPlusieursInto
+
+class MonWidgetIntoSug (Ui_WidgetIntoSug, MonWidgetPlusieursInto):
+# Attention Attention
+# cette wdget ne fonctionne actuellement que pour Telemac
+# on attend du texte . on n essaye pas de transformer
+
+ def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
+
+ MonWidgetPlusieursInto.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
+ self.lineEditVal.returnPressed.connect(self.LEValeurAjouteDsPossible)
+
+ def LEValeurAjouteDsPossible(self):
+ text=str(self.lineEditVal.text())
+ if text == "" : return
+ # il faudrait essauer d en obtenir un reel, un tuple ou ...
+ # si cela est utilise pour autre chose que Telemac
+ if not isinstance(text,str) :
+ self.lineEditVal.setText("")
+ print ('jkjkl')
+ return
+ self.monSimpDef.intoSug.insert(0,text)
+ self.setValeurs()
from Extensions.i18n import tr
-from .feuille import Feuille
-from desWidgetPlusieursInto import Ui_WidgetPlusieursInto
-from .politiquesValidation import PolitiquePlusieurs
-from .qtSaisie import SaisieValeur
-from .gereListe import GerePlie
-from .gereListe import GereListe
+from InterfaceQT4.feuille import Feuille
+from desWidgetPlusieursInto import Ui_WidgetPlusieursInto
+from InterfaceQT4.politiquesValidation import PolitiquePlusieurs
+from InterfaceQT4.qtSaisie import SaisieValeur
+from InterfaceQT4.gereListe import GerePlie
+from InterfaceQT4.gereListe import GereListe
class MonWidgetPlusieursInto (Ui_WidgetPlusieursInto,Feuille,GerePlie,GereListe):
else :
self.listeAAfficher=self.node.item.get_liste_possible([])
+ if self.node.item.has_intoSug() : self.listeAAfficher=self.node.item.get_liste_possible_avecSug([])
+
+
if self.objSimp.wait_assd() :
self.listeAAfficher=self.node.item.get_sd_avant_du_bon_type()
if self.listeAAfficher== None or self.listeAAfficher==[] : self.listeAAfficher=[]
def changeValeur(self):
if self.inhibe == True: return
- self.noircirResultatFiltre()
+ if hasattr(self,'LEFiltre') :self.noircirResultatFiltre()
self.listeValeursCourantesAvant=self.listeValeursCourantes
self.listeValeursCourantes = []
eficas_compile_ui ( desWidgetHeure.ui )
eficas_compile_ui ( desWidgetInactif.ui )
eficas_compile_ui ( desWidgetInformation.ui )
+eficas_compile_ui ( desWidgetIntoSug.ui )
eficas_compile_ui ( desWidgetMatrice.ui )
eficas_compile_ui ( desWidgetParam.ui )
eficas_compile_ui ( desWidgetPlusieursBase.ui )
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>WidgetIntoSug</class>
+ <widget class="QWidget" name="WidgetIntoSug">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>1049</width>
+ <height>400</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>400</height>
+ </size>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="sizeConstraint">
+ <enum>QLayout::SetFixedSize</enum>
+ </property>
+ <item>
+ <widget class="QToolButton" name="BFermeListe">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>21</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>permet de gérer la liste</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">border:0px</string>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>../Editeur/icons/minusnode.png</normaloff>../Editeur/icons/minusnode.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="MonBoutonValide" name="RBValide">
+ <property name="minimumSize">
+ <size>
+ <width>21</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>21</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>Qt::ClickFocus</enum>
+ </property>
+ <property name="toolTip">
+ <string>Affiche le rapport de validation du mot-clef</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">border : 0px</string>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>../Editeur/icons/ast-green-ball.png</normaloff>../Editeur/icons/ast-green-ball.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>5</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="MonLabelClic" name="label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>280</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>280</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="text">
+ <string><html><head/><body><p>aaa</p><p>dqsklmdqm</p></body></html></string>
+ </property>
+ <property name="scaledContents">
+ <bool>false</bool>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QScrollArea" name="scrollAreaCommentaire">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>300</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>300</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="widgetResizable">
+ <bool>true</bool>
+ </property>
+ <widget class="QWidget" name="scrollAreaWidgetContents_2">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>300</width>
+ <height>316</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <property name="horizontalSpacing">
+ <number>0</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="monCommentaireLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>78</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>278</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="text">
+ <string><html><head/><body><p><br/></p></body></html></string>
+ </property>
+ <property name="scaledContents">
+ <bool>false</bool>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <spacer name="verticalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_6">
+ <property name="spacing">
+ <number>15</number>
+ </property>
+ <item>
+ <widget class="QFrame" name="frameHorsListe">
+ <property name="styleSheet">
+ <string notr="true">background:rgb(221, 221, 166)</string>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::Box</enum>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string>Valeurs hors liste - la valeur saisie sera ajoutée à la liste</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEditVal">
+ <property name="styleSheet">
+ <string notr="true">background : white
+</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QScrollArea" name="scrollArea">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">background : rgb(247,247,247)</string>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="widgetResizable">
+ <bool>true</bool>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
+ </property>
+ <widget class="QWidget" name="verticalWidgetLE">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>614</width>
+ <height>297</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <layout class="QVBoxLayout" name="CBLayout">
+ <item>
+ <spacer name="verticalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Preferred</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QToolButton" name="RBPoubelle">
+ <property name="minimumSize">
+ <size>
+ <width>21</width>
+ <height>31</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>21</width>
+ <height>31</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Détruit le mot-clef</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">border : 0px</string>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>../Editeur/icons/deleteRond.png</normaloff>../Editeur/icons/deleteRond.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>32</width>
+ <height>32</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="CBCheck">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ <zorder>horizontalSpacer</zorder>
+ <zorder></zorder>
+ <zorder></zorder>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>MonBoutonValide</class>
+ <extends>QToolButton</extends>
+ <header>monBoutonValide.h</header>
+ </customwidget>
+ <customwidget>
+ <class>MonLabelClic</class>
+ <extends>QLabel</extends>
+ <header>monLabelClic.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
desWidgetOptionnel.py desWidgetOptionnelMC.py Tuple2.py Tuple3.py \
desWidgetBloc.py desWidgetCB.py desWidgetCommentaire.py desWidgetDate.py \
desWidgetFact.py desWidgetFactPlie.py desWidgetFormule.py desGroupeOptionnel.py \
- desWidgetHeure.py desWidgetInformation.py desWidgetInactif.py \
+ desWidgetHeure.py desWidgetInformation.py desWidgetIntoSug.py desWidgetInactif.py \
desWidgetMatrice.py desWidgetParam.py desWidgetPlusieursBase.py desWidgetPlusieursInto.py \
desWidgetPlusieursIntoOrdonne.py desWidgetPlusieursTuple.py desWidgetRadioButton.py \
desWidget4a6RadioButton.py desWidgetSimpBase.py desWidgetSDCOInto.py desWidgetSimpBool.py \
- desWidgetSimpSalome.py desPBMT.py\
+ desWidgetSimpSalome.py desPBMT.py desPBOptionnelMT.py\
desWidgetSimpComplexe.py desWidgetSimpFichier.py desWidgetSimpTxt.py desWidgetTuple2.py \
desWidgetTuple3.py desWidgetVide.py desWidgetUniqueSDCO.py desWidgetPlusieursPlie.py
except NameError:
basestring = str
-pattern_comment_slash = re.compile(r"^\s*/")
+pattern_comment_slash = re.compile(r"^\s*/")
+pattern_comment_slash_vide = re.compile(r"^\s*/\s*$")
pattern_eta = re.compile(r".*&ETA.*")
pattern_fin = re.compile(r".*&FIN.*")
pattern_oui = re.compile(r"^\s*(oui|OUI|YES|yes|TRUE|VRAI)\s*$")
l_lignes_texte_all = self.text.split('\n')
l_lignes_texte = []
+ listeComment = []
+ dicoComment={}
+ dicoCommentSimp={}
+ dicoCommentMC={}
+ texteComment=""
+ debut=True
for l in l_lignes_texte_all :
- if not(pattern_comment_slash.match(l)): l_lignes_texte.append(l)
+ if pattern_eta.match(l) : continue
+ if pattern_fin.match(l) : continue
+ if pattern_blanc.match(l) : continue
+
+ if not(pattern_comment_slash.match(l)):
+ l_lignes_texte.append(l)
+ if trouveComment :
+ if debut: dicoComment['debut']=texteComment
+ else : dicoComment[l]=texteComment
+ trouveComment = 0
+ texteComment=""
+ if debut : debut = False
+
+ if pattern_comment_slash.match(l):
+ if pattern_comment_slash_vide.match(l) : continue
+ texteComment+=l.replace ('/','#',1)
+ texteComment+='\n'
+ trouveComment=1
+
+ if texteComment != "" : dicoComment['fin']= texteComment
+
l_lignes=[]
i=0
for ligne in l_lignes :
if pattern_comment_slash.match(ligne) : continue
- if pattern_eta.match(ligne) : continue
- if pattern_fin.match(ligne) : continue
- if pattern_blanc.match(ligne) : continue
+ #PN : deja teste
+ #if pattern_eta.match(ligne) : continue
+ #if pattern_fin.match(ligne) : continue
+ #if pattern_blanc.match(ligne) : continue
finLigne=ligne
finLigne=m.group('reste')
self.dictSimp[simpCas]=valeur
+
+ if ligne in dicoComment.keys():
+ dicoCommentSimp[simpCas]=dicoComment[ligne]
if 'TITLE' not in self.dictSimp :
import os
#self.dictSimp['TITLE']=os.path.basename(self.filename)
+
dicoParMC={}
for simp in self.dictSimp:
if simp in TELEMACParser.__dict__ : TELEMACParser.__dict__[simp],(self,)
listeGeneaReverse.reverse()
dicoTravail=dicoParMC
i=0
+ if simp in dicoCommentSimp :
+ MC=listeGeneaReverse[0]
+ if MC in dicoCommentMC : dicoCommentMC[MC]+dicoCommentSimp[simp]
+ else : dicoCommentMC[MC]=dicoCommentSimp[simp]
while i < len(listeGeneaReverse[0:-1]) :
mot=listeGeneaReverse[i]
i=i+1
self.textePy=""
listeMC=self.tri(list(dicoParMC.keys()))
for k in listeMC :
+ if k in dicoCommentMC :
+ commentaire="COMMENTAIRE("+repr(dicoCommentMC[k])+")\n"
+ self.textePy+=commentaire
self.textePy += str(k )+ "("
self.traiteMC(dicoParMC[k])
self.textePy += ");\n"
appli.listeTelemac=self.dictSimp
+ if 'debut' in dicoComment :
+ commentaire="COMMENTAIRE("+repr(dicoComment['debut'])+")\n"
+ self.textePy=commentaire+self.textePy
+ if 'fin' in dicoComment :
+ commentaire="COMMENTAIRE("+repr(dicoComment['fin'])+")\n"
+ self.textePy=self.textePy+commentaire
+
return self.textePy
def convert(self,outformat,appli=None):
if outformat == 'exec':
try:
- #return parseur_python.PARSEUR_PYTHON(self.text).get_texte(appli)
return PARSEUR_PYTHON(self.text).get_texte(appli)
except EficasException:
# Erreur lors de la conversion