/usr/share/pyshared/InterfaceQT4/compomacro.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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | # -*- coding: utf-8 -*-
# Modules Python
import os,sys,string
import types
import traceback
# Modules Eficas
from Editeur import Objecttreeitem
import compooper
import browser
import typeNode
class MACRONode(browser.JDCNode,typeNode.PopUpMenuNode):
def getPanel(self):
from monMacroPanel import MonMacroPanel
return MonMacroPanel (self,parent=self.editor )
def createPopUpMenu(self):
typeNode.PopUpMenuNode.createPopUpMenu(self)
#def doPaste(self,node_selected):
# print 'je suis la'
# objetACopier = self.item.get_copie_objet()
# child=self.append_brother(objetACopier)
# return child
class MACROTreeItem(compooper.EtapeTreeItem):
# """ Cette classe hérite d'une grande partie des comportements
# de la classe compooper.EtapeTreeItem
# """
itemNode=MACRONode
# ------------------------------------
# Classes necessaires à INCLUDE
# ------------------------------------
class INCLUDETreeItemBase(MACROTreeItem):
def __init__(self,appli, labeltext, object, setfunction):
MACROTreeItem.__init__(self,appli, labeltext, object, setfunction)
def iscopiable(self):
return 0
class INCLUDENode(browser.JDCNode,typeNode.PopUpMenuNode):
def getPanel(self):
from monIncludePanel import MonIncludePanel
return MonIncludePanel (self,parent=self.editor )
def createPopUpMenu(self):
typeNode.PopUpMenuNode.createPopUpMenu(self)
def makeEdit(self): #,appli,node
if self.item.object.text_converted == 0:
# Le texte du fichier inclus n'a pas pu etre converti par le module convert
msg="Le fichier de commande n'a pas pu etre converti pour etre editable par Eficas\n\n"
msg=msg+self.item.object.text_error
return
if not hasattr(self.item.object,"jdc_aux") or self.item.object.jdc_aux is None:
#L'include n'est pas initialise
self.item.object.build_include(None,"")
# On cree un nouvel onglet dans le bureau
self.editor.vm.displayJDC( self.item.object.jdc_aux , self.item.object.jdc_aux.nom )
class INCLUDETreeItem(INCLUDETreeItemBase):
itemNode=INCLUDENode
# ------------------------------------
# Classes necessaires à POURSUITE
# ------------------------------------
class POURSUITENode(browser.JDCNode, typeNode.PopUpMenuNode):
def getPanel(self):
from monPoursuitePanel import MonPoursuitePanel
return MonPoursuitePanel (self,parent=self.editor )
def createPopUpMenu(self):
typeNode.PopUpMenuNode.createPopUpMenu(self)
def makeEdit(self): #,appli,node
if self.item.object.text_converted == 0:
msg="Le fichier de commande n'a pas pu etre converti pour etre editable par Eficas\n\n"
msg=msg+self.item.object.text_error
return
if not hasattr(self.item.object,"jdc_aux") or self.item.object.jdc_aux is None:
text="""DEBUT()
FIN()"""
self.object.build_poursuite(None,text)
# On cree un nouvel onglet dans le bureau
self.editor.vm.displayJDC( self.item.object.jdc_aux , self.item.object.jdc_aux.nom)
class POURSUITETreeItem(INCLUDETreeItemBase):
itemNode=POURSUITENode
# ----------------------------------------
# Classes necessaires à INCLUDE MATERIAU
# ----------------------------------------
class MATERIAUNode(MACRONode):
def getPanel(self):
from monMacroPanel import MonMacroPanel
return MonMacroPanel (self,parent=self.editor )
def createPopUpMenu(self):
typeNode.PopUpMenuNode.createPopUpMenu(self)
def makeView(self) :
if hasattr(self.item.object,'fichier_ini') and self.item.object.fichier_ini==None:
QMessageBox.information( self, "Include vide","L'include doit etre correctement initialisé pour etre visualisé")
return
f = open(self.item.object.fichier_ini, "rb")
texte = f.read()
f.close()
from desVisu import DVisu
monVisuDialg=DVisu(parent=self.editor.appliEficas,fl=0)
monVisuDialg.TB.setText(texte)
monVisuDialg.show()
class INCLUDE_MATERIAUTreeItem(INCLUDETreeItemBase):
itemNode=MATERIAUNode
# ------------------------------------
# TreeItem
# ------------------------------------
def treeitem(appli, labeltext, object, setfunction=None):
""" Factory qui retourne l'item adapte au type de macro :
INCLUDE, POURSUITE, MACRO
"""
if object.nom == "INCLUDE_MATERIAU":
return INCLUDE_MATERIAUTreeItem(appli, labeltext, object, setfunction)
elif object.nom == "INCLUDE":
return INCLUDETreeItem(appli, labeltext, object, setfunction)
elif object.nom == "POURSUITE":
return POURSUITETreeItem(appli, labeltext, object, setfunction)
else:
return MACROTreeItem(appli, labeltext, object, setfunction)
import Accas
objet=Accas.MACRO_ETAPE
|