/usr/share/pyshared/InterfaceQT4/compofact.py is in eficas 6.4.0-1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | # -*- coding: utf-8 -*-
# CONFIGURATION MANAGEMENT OF EDF VERSION
# ======================================================================
# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
# (AT YOUR OPTION) ANY LATER VERSION.
#
# THIS PROGRAM 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
# GENERAL PUBLIC LICENSE FOR MORE DETAILS.
#
# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
#
#
# ======================================================================
from PyQt4 import *
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import browser
import typeNode
from Editeur import Objecttreeitem
class Node(browser.JDCNode,typeNode.PopUpMenuNodePartiel):
def getPanel(self):
"""
"""
from monMCFactPanel import MonMCFactPanel
return MonMCFactPanel(self,parent=self.editor)
def createPopUpMenu(self):
typeNode.PopUpMenuNodeMinimal.createPopUpMenu(self)
class FACTTreeItem(Objecttreeitem.ObjectTreeItem):
itemNode=Node
def IsExpandable(self):
return 1
def GetText(self):
return ''
def GetLabelText(self):
""" Retourne 3 valeurs :
- le texte à afficher dans le noeud représentant l'item
- la fonte dans laquelle afficher ce texte
- la couleur du texte
"""
# None --> fonte et couleur par défaut
return self.object.getlabeltext(),None,None
def isvalid(self):
return self.object.isvalid()
def iscopiable(self):
return 1
def GetIconName(self):
if self.object.isvalid():
return "ast-green-los"
elif self.object.isoblig():
return "ast-red-los"
else:
return "ast-yel-los"
def keys(self):
keys=self.object.mc_dict.keys()
return keys
def GetSubList(self):
"""
Reactualise la liste des items fils stockes dans self.sublist
"""
liste=self.object.mc_liste
sublist=[None]*len(liste)
# suppression des items lies aux objets disparus
for item in self.sublist:
old_obj=item.getObject()
if old_obj in liste:
pos=liste.index(old_obj)
sublist[pos]=item
else:
pass # objets supprimes ignores
# ajout des items lies aux nouveaux objets
pos=0
for obj in liste:
if sublist[pos] is None:
# nouvel objet : on cree un nouvel item
def setfunction(value, object=obj):
object.setval(value)
item = self.make_objecttreeitem(self.appli, obj.nom + " : ", obj, setfunction)
sublist[pos]=item
pos=pos+1
self.sublist=sublist
return self.sublist
def additem(self,name,pos):
objet = self.object.addentite(name,pos)
return objet
def suppitem(self,item) :
"""
Cette methode a pour fonction de supprimer l'item passee en argument
des fils de l'item FACT qui est son pere
- item = item du MOCLE a supprimer du MOCLE pere
- item.getObject() = MCSIMP ou MCBLOC
"""
itemobject=item.getObject()
if itemobject.isoblig() :
self.appli.affiche_infos('Impossible de supprimer un mot-clé obligatoire ',Qt.red)
return 0
if self.object.suppentite(itemobject):
message = "Mot-clé " + itemobject.nom + " supprimé"
self.appli.affiche_infos(message)
return 1
else:
self.appli.affiche_infos('Pb interne : impossible de supprimer ce mot-clé',Qt.red)
return 0
import Accas
objet = Accas.MCFACT
treeitem = FACTTreeItem
|