# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2013 EDF R&D
+# Copyright (C) 2007-2021 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
import types,os,re,sys
import traceback
-import six
+import inspect
from PyQt5.QtWidgets import QMessageBox, QFileDialog , QMenu, QPushButton, QTreeView ,QListView, QAbstractItemView
from PyQt5.QtGui import QIcon
def setReglesEtAide(self):
listeRegles=()
try :
- listeRegles = self.node.item.get_regles()
+ listeRegles = self.node.item.getRegles()
except :
pass
if hasattr(self,"RBRegle"):
if isinstance(self,MonWidgetCommande) and self.editor.code =="MAP":
self.cle_doc = self.chercheDocMAP()
else :
- self.cle_doc = self.node.item.get_docu()
+ self.cle_doc = self.node.item.getDocu()
if self.cle_doc == None : self.RBInfo.close()
else : self.RBInfo.clicked.connect (self.viewDoc)
def chercheDocMAP(self):
try :
- clef=self.editor.CONFIGURATION.adresse+"/"
+ clef=self.editor.maConfiguration.adresse+"/"
except :
return None
- for k in self.editor.readercata.cata[0].JdC.dict_groupes:
- if self.obj.nom in self.editor.readercata.cata[0].JdC.dict_groupes[k]:
+ for k in self.editor.readercata.cata.JdC.dict_groupes:
+ if self.obj.nom in self.editor.readercata.cata.JdC.dict_groupes[k]:
clef+=k
break
clef+="/"+ self.obj.nom[0:-5].lower()+"/spec_"+self.obj.nom[0:-5].lower()+".html"
QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee "))
def viewRegles(self):
- self.node.AppelleBuildLBRegles()
+ self.node.appellebuildLBRegles()
def setIconePoubelle(self):
if not(hasattr(self,"RBPoubelle")):return
- if self.node.item.object.isoblig() and not( hasattr(self.node.item.object,'isDeletable') ):
+ if self.node.item.object.isOblig() and not( hasattr(self.node.item.object,'isDeletable') ):
icon=QIcon(self.repIcon+"/deleteRondVide.png")
self.RBPoubelle.setIcon(icon)
return
self.node.delete()
def setValide(self):
- #print " c est le moment de gerer le passage au suivant"
if not(hasattr (self,'RBValide')) : return
- icon = QIcon()
- if self.node.item.object.isvalid() :
- icon=QIcon(self.repIcon+"/ast-green-ball.png")
- else :
- icon=QIcon(self.repIcon+"/ast-red-ball.png")
- self.RBValide.setIcon(icon)
+ couleur=self.node.item.getIconName()
+ monIcone = QIcon(self.repIcon+"/" + couleur + ".png")
+ self.RBValide.setIcon(monIcone)
# il faut chercher la bonne fenetre
def rendVisible(self):
def choixSaisi(self):
fction=str(self.CBScripts.currentText())
numero= self.dictCommandes[fction]
- self.node.AppelleFonction(numero,nodeTraite=self.node)
+ self.node.appelleFonction(numero,nodeTraite=self.node)
#self.reaffiche()
class ContientIcones(object):
from .monViewTexte import ViewText
try :
if sys.platform[0:5]=="linux" :
- cmd="xdg-open "+ str(fichier)
+ #cmd="xdg-open "+ str(fichier)
+ #changer pour marcher dans l'EDC
+ #cmd="gedit "+ str(fichier)
+ from os.path import splitext
+ fileName,extension = splitext(fichier)
+ if extension in self.parentQt.editor.appliEficas.maConfiguration.utilParExtensions:
+ cmd=self.parentQt.editor.appliEficas.maConfiguration.utilParExtensions[extension] + " " + str(fichier)
+ else: cmd="xdg-open "+ str(fichier)
os.system(cmd)
else :
os.startfile(str(fichier))
if len(mctype) > 2 and mctype[2] == "Sauvegarde":
fichier = QFileDialog.getSaveFileName(self.appliEficas,
tr('Sauvegarder Fichier'),
- self.appliEficas.CONFIGURATION.savedir,
+ self.appliEficas.maConfiguration.savedir,
filters)
else:
- print(filters)
+ #print(filters)
fichier = QFileDialog.getOpenFileName(self.appliEficas,
tr('Ouvrir Fichier'),
- self.appliEficas.CONFIGURATION.savedir,
+ self.appliEficas.maConfiguration.savedir,
filters)
fichier=fichier[0]
if not(fichier == ""):
- ulfile = os.path.abspath(six.text_type(fichier))
- self.appliEficas.CONFIGURATION.savedir=os.path.split(ulfile)[0]
+ ulfile = os.path.abspath(fichier)
+ self.appliEficas.maConfiguration.savedir=os.path.split(ulfile)[0]
self.lineEditVal.setText(fichier)
- self.editor.affiche_commentaire(tr("Fichier selectionne"))
- self.LEValeurPressed()
+ self.editor.afficheCommentaire(tr("Fichier selectionne"))
+ self.LEvaleurPressed()
if (QFileInfo(fichier).suffix() in listeSuffixe ):
self.image=fichier
if (not hasattr(self,"BSelectInFile")):
def BFichierOuRepertoirePressed(self):
self.fileName=""
- print (0)
self.file_dialog=QFileDialog()
- print (1)
self.file_dialog.setFileMode(QFileDialog.Directory);
- print (2)
self.file_dialog.setFileMode(QFileDialog.Directory|QFileDialog.ExistingFiles)
- print (3)
self.file_dialog.setOption(QFileDialog.DontUseNativeDialog,True);
self.file_dialog.setWindowTitle('Choose File or Directory')
self.explore(self.file_dialog)
self.file_dialog.exec_()
if self.fileName == "" : return
self.lineEditVal.setText(self.fileName)
- self.LEValeurPressed()
+ self.LEvaleurPressed()
def explore(self,widget):
def BRepertoirePressed(self):
directory = QFileDialog.getExistingDirectory(self.appliEficas,
- directory = self.appliEficas.CONFIGURATION.savedir,
+ directory = self.appliEficas.maConfiguration.savedir,
options = QFileDialog.ShowDirsOnly)
if not (directory == "") :
- absdir = os.path.abspath(six.text_type(directory))
- self.appliEficas.CONFIGURATION.savedir = os.path.dirname(absdir)
+ absdir = os.path.abspath(directory)
+ self.appliEficas.maConfiguration.savedir = os.path.dirname(absdir)
self.lineEditVal.setText(directory)
- self.LEValeurPressed()
+ self.LEvaleurPressed()
def BSelectInFilePressed(self):
from monSelectImage import MonSelectImage
def BSalomePressed(self):
- self.editor.affiche_commentaire("")
+ self.editor.afficheCommentaire("")
selection=[]
commentaire=""
- genea=self.node.item.get_genealogie()
+ genea=self.node.item.getGenealogie()
kwType = self.node.item.get_definition().type[0]
for e in genea:
if "GROUP_NO" in e: kwType = "GROUP_NO"
return
from Accas import SalomeEntry
- if isinstance(kwType, type) and issubclass(kwType, SalomeEntry):
+ if inspect.isclass(kwType) and issubclass(kwType, SalomeEntry):
selection, commentaire = self.appliEficas.selectEntryFromSalome(kwType,editor=self.editor)
if commentaire !="" :
- self.editor.affiche_infos(tr(str(commentaire)))
+ self.editor.afficheInfos(tr(str(commentaire)))
if selection == [] : return
- min,max=self.node.item.GetMinMax()
+ min,max=self.node.item.getMinMax()
if max > 1 :
self.ajoutNValeur(selection)
return
for geomElt in selection: monTexte=geomElt+","
monTexte= monTexte[0:-1]
self.lineEditVal.setText(str(monTexte))
- self.LEValeurPressed()
+ self.LEvaleurPressed()
def BView2DPressed(self):
try :
if valeur :
ok, msgError = self.appliEficas.displayShape(valeur)
if not ok:
- self.editor.affiche_infos(msgError,Qt.red)
+ self.editor.afficheInfos(msgError,Qt.red)
def BParametresPressed(self):
- liste=self.node.item.get_liste_param_possible()
+ liste=self.node.item.getListeParamPossible()
from monListeParamPanel import MonListeParamPanel
MonListeParamPanel(liste=liste,parent=self).show()