From b84bfc4d15c7e422306ecd21c5cf37b7ec78a336 Mon Sep 17 00:00:00 2001 From: PASCALE NOYRET Date: Wed, 19 Jan 2022 18:14:07 +0100 Subject: [PATCH] sup et add correction --- InterfaceWeb/browser.py | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/InterfaceWeb/browser.py b/InterfaceWeb/browser.py index f8dfe8c2..1fcc069d 100644 --- a/InterfaceWeb/browser.py +++ b/InterfaceWeb/browser.py @@ -41,17 +41,18 @@ class JDCTree(): def __init__( self, jdc_item, editor): #---------------------------------------- - print ('__init__ JDCTree') + #print ('__init__ JDCTree') self.editor = editor - self.plie=False + self.plie = False self.item = jdc_item self.tree = self self.appliEficas = self.editor.appliEficas - self.racine=self.item.itemNode(self,self.item) + self.racine = self.item.itemNode(self,self.item) self.itemCourant=None self.node_selected = self.racine self.inhibeExpand = True self.childrenComplete=[] + #print ('fin __init__ JDCTree') # def handleContextMenu(self,item,coord): #------------------------------------- @@ -103,8 +104,8 @@ class JDCNode(): def onValid(self): #----------------- - #print ('ds onValid') validite=self.item.isValid() + #print ('ds onValid', self.item.nom, '_________________________________________________', self.oldValidite, validite) if self.oldValidite==validite : return if self.oldValidite=='init' : self.oldValidite=validite @@ -158,14 +159,14 @@ class JDCNode(): def onSupp(self,suppression): #--------------------------- - print ('on Supp', suppression) + #print ('on Supp', suppression) if len(suppression) > 1 : self.buildChildren() self.editor.connecteur.toWebApp('remplacementNode',self.item.remplaceId,self.item.idUnique(),self.item.getDicoForFancy()) return mcSupprime= suppression[0] - if mcSupprime.nature != 'MCBLOC' : liste=self.item.idUnique - else : + if mcSupprime.nature != 'MCBLOC' : liste=(mcSupprime.idUnique,) + else : liste=[] listeMC=mcSupprime.getAllChildInBloc() for mc in listeMC : liste.append(mc.idUnique) @@ -209,7 +210,7 @@ class JDCNode(): self.childrenItemComplete=self.construitChildrenComplete() - if self.item.nom == 'web_tres_simple_avec_2Procs.comm' : print (self.children) + #if self.item.nom == 'web_tres_simple_avec_2Procs.comm' : print (self.children) #print ("fin *********** buildChildren ",self,self.item, self.item.nom, self.children) @@ -255,17 +256,19 @@ class JDCNode(): elif type(pos) == int : index = pos # position fixee elif type(pos) == object : index = self.item.getIndex(pos) +1 # pos est un item. Il faut inserer name apres pos elif type(name) == object : index = self.item.getIndexChild(name.nom) - else : index = self.item.getIndexChild(name) + elif self.item.nature != 'JDC' : index = self.item.getIndexChild(name) + else : return None - print (self.children) obj = self.item.addItem(name,index) # emet le signal 'add' - if obj is None : obj=0 - print (self.children) - child=self.children[index] - #try : - # if len(obj) > 1 : self.buildChildren() - #except : pass + try : + print (index) + self.buildChildren() + print (self.children) + child=self.children[index] + except : + print ('pb u buildChildren dans appendChild') + pass print ("-------------- fin append child", child, child.item) @@ -277,7 +280,7 @@ class JDCNode(): """ Methode externe pour la destruction de l'objet associe au noeud """ - index = self.vraiParent.children.index(self) - 1 + print ('________________appel de delete _______', self) ret,commentaire=self.vraiParent.item.suppItem(self.item) if ret!=0 : self.treeParent.buildChildren() return (ret,commentaire) -- 2.39.2