class CatalogDescription(object):
- def __init__(self, identifier, cata_file_path, file_format = "python",
- default = False, code = None,ss_code=None, user_name = None,
- selectable = True, file_format_in = "python"):
+ def __init__(self, labelCode, fichierCata, formatFichierOut = "python", formatFichierIn='python',
+ default = False, code = None,ss_code=None,):
"""
This class can be used to describe an Eficas catalog.
- :type identifier: string
- :param identifier: unique identifier for the catalog
+ :type labelCode: string
+ :param labelCode: unique labelCode for the catalog
- :type cata_file_path: string
- :param cata_file_path: path of the file containing the catalog itself
+ :type fichierCata: string
+ :param fichierCata: path of the file containing the catalog itself
- :type file_format: string
- :param file_format: format of the files generated when using this
- catalog
+ :type fileFormatOut: string
+ :param fileFormatOut: format of the files generated when using this catalog
:type default: boolean
- :param default: indicate if this catalog is the default one (appear on
- the top of the catalogs list)
+ :param default: indicate if this catalog is the default one (appear on the top of the catalogs list)
:type code: string
- :param code: Deprecated. Used to indicate the code associated to this
- catalog
+ :param code: Used to indicate the code associated to this catalog
:type ss_code: string
:param ss_code: scheme associated to this catalog (Map only)
- :type user_name: string
- :param user_name: name of the catalog as it will appear in the list
-
- :type selectable: boolean
- :param selectable: indicate if this catalog appears in the list.
- Setting this parameter to False is useful to keep
- old catalogs to edit existing files but to forbid
- to use them to create new files.
"""
- self.identifier = identifier
- self.cata_file_path = cata_file_path
- self.file_format = file_format
+
+ self.labelCode = labelCode
+ self.fichierCata = fichierCata
+ self.formatFichierOut = formatFichierOut
+ self.formatFichierIn = formatFichierIn
self.default = default
self.code = code
- if user_name is None:
- self.user_name = identifier
- else:
- self.user_name = user_name
- self.selectable = selectable
- self.file_format_in = file_format_in
@staticmethod
- def create_from_tuple(cata_tuple):
+ def createFromTuple(cataTuple):
#print "Warning: Describing a catalog with a tuple is deprecated. " \
# "Please create a CatalogDescription instance directly."
- desc = CatalogDescription(code = cata_tuple[0],
- identifier = cata_tuple[1],
- cata_file_path = cata_tuple[2],
- file_format = cata_tuple[3])
+ if cataTuple[0] == 'MAP' :
+ desc = CatalogDescription(code = cataTuple[0],
+ labelCode = cataTuple[1],
+ fichierCata = cataTuple[2],
+ ssCode = cataTuple[3],
+ formatFichierOut = 'MAP',
+ formatFichierIn = 'MAP')
+ elif len(cataTuple) == 4:
+ desc = CatalogDescription(code = cataTuple[0],
+ labelCode = cataTuple[1],
+ fichierCata = cataTuple[2],
+ formatFichierOut = cataTuple[3],
+ formatFichierIn = 'python')
+ elif len(cataTuple) == 5 :
+ desc = CatalogDescription(code = cataTuple[0],
+ labelCode = cataTuple[1],
+ fichierCata = cataTuple[2],
+ formatFichierOut = cataTuple[3],
+ formatFichierIn = cataTuple[4])
+ elif len(cataTuple) == 6 :
+ desc = CatalogDescription(code = cataTuple[0],
+ labelCode = cataTuple[1],
+ fichierCata = cataTuple[2],
+ formatFichierOut = cataTuple[3],
+ formatFichierIn = cataTuple[4],
+ defaut=cataTuple[5])
+ else :
+ print ('pb a la description du catalogue avec les donnees')
+ print (cataTuple)
+ desc=None
- if len(cata_tuple) == 5:
- if cata_tuple[4] == "defaut":
- desc.default = True
- else:
- desc.file_format_in = cata_tuple[4]
return desc
Ce module centralise les informations issues de la ligne de commande.
La ligne de commande est parsee avec l'aide du module python optparse.
-Les options possibles sont : -c, -j, -p, -d, -i, -f comme definies ci-dessous.
+Les options possibles sont : -l, -j, -p, -d, -i, -f comme definies ci-dessous.
Un exemple typique d'utilisation est :
->>> ./appli.py -c V7.3 -d 1 -j aa -i 11 iii -p ppp -i 22 ii -j bb -f ff
+>>> ./appli.py -v V7.3 -d 1 -j aa -i 11 iii -p ppp -i 22 ii -j bb -f ff
qui demande a l'application d'ouvrir trois jeux de commandes.
def createparser():
# creation du parser des options de la ligne de commande
#import prefs
- parser=optparse.OptionParser(usage=tr("utilisation : %prog [options]"), version="%prog 1.13")
+ parser=optparse.OptionParser(usage=tr("utilisation : %prog [options]"), version="%prog 9.5")
parser.add_option(u"-j","--jdc",dest="comm",type='string',
action="callback",callback=checkComm,
action="callback", callback=checkInclude,
nargs=2, help=tr("numero d'unite suivi du nom du fichier include"))
- parser.add_option(u"-f","--fich", type="string",dest="fich",
- action="callback", callback=checkFich,
- help=tr("fichier decrivant une etude"))
+ #parser.add_option(u"-f","--fich", type="string",dest="fich",
+ # action="callback", callback=checkFich,
+ # help=tr("fichier decrivant une etude"))
parser.add_option(u"-c","--cata", action="store", type="string",dest="fichierCata",
- help=tr("version de catalogue a utiliser"))
+ help=tr("catalogue a utiliser"))
- parser.add_option(u"-v","--version_cata", action="store", type="string",dest="version_cata",
+ parser.add_option(u"-v","--label", action="store", type="string",dest="labelCode",
help=tr("version de catalogue a utiliser"))
parser.add_option(u"-d","--debug", action="store", type="int",dest="debug",
help=tr("niveau de debug"))
+ parser.add_option(u"-x","--withXSD", action="store_true", dest="withXSD",
+ default=False,
+ help=tr("construit le .xml en meme temps que le .comm"))
+
parser.add_option(u"-s","--schema", action="store", type="string",dest="ssCode",
help=tr("schema"))
# To handle locale information
- parser.add_option("-l", "--locale", action="store", type="string", dest="locale",
- help=tr("localisation de l'application, pour la traduction"))
+ #parser.add_option("-l", "--locale", action="store", type="string", dest="locale",
+ # help=tr("localisation de l'application, pour la traduction"))
return parser
if not hasattr(options,"studies"):
options.studies=[]
options.comm=[]
+ if not hasattr(options,"fichierCata"): options.fichierCata=None
+ if not hasattr(options,"labelCode"): options.labelCode=None
try:
del parser.values.current
except:
global d_env
d_env=options
#printDEnv()
+ #print (options)
return options
def getUnit(d_study,appliEficas):
e.updateContext(context)
def analyse(self):
- #if self.editor.format_in == 'xml' :
# il ne faut pas le faire quand le jeu de donnees est vide
# self.setCurrentContext()
# self.analyseFromXML()
représentatif de self.object
"""
# Format de fichier utilisé
- format=self.appliEficas.format_fichier
+ format=self.appliEficas.formatFichierIn
return self.object.getObjetCommentarise(format)
def getObjetCommentarise_BAK(self):
try :
prefsCode=__import__(name)
except :
+ self.catalogues=[]
print ('pas de fichier de prefs')
return
for k in dir(prefsCode):
if self.maConfiguration.boutonDsMenuBar : self.appliEficas.remplitIconesCommandes()
- self.format = self.appliEficas.format_fichier
- self.format_in = self.appliEficas.format_fichier_in
+ self.formatFichierOut = self.appliEficas.formatFichierOut
+ self.formatFichierIn = self.appliEficas.formatFichierIn
self.node_selected = []
self.deplier = True
if self.modified or self.fichier==None :
QMessageBox.critical( self, tr( "Execution impossible "),tr("Sauvegarder SVP avant l'execution "))
return
- if not hasattr(self,'generator'): texte=self.getTextJDC(self.format)
+ if not hasattr(self,'generator'): texte=self.getTextJDC(self.formatFichierOut)
from PrepareRunCarmel import prepareRunCarmel
fichierGenerique=os.path.basename(self.fichier).split(".")[0]
repMed=os.path.dirname(self.fichier)
extension='.casR'
fn = self.fichierComplet
#saveas=True # Pour forcer le nom
- self.generator=self.maConfiguration.mesGenerators.plugins[self.format]()
+ self.generator=self.maConfiguration.mesGenerators.plugins[self.formatFichierOut]()
if self.fichierComplet is None or saveas:
if path is None: path=self.maConfiguration.savedir
bOK, fn=self.determineNomFichier(path,extension)
ulfile = os.path.abspath(fn)
self.appliEficas.maConfiguration.savedir=os.path.split(ulfile)[0]
- # On utilise le convertisseur defini par format_fichier
+ # On utilise le convertisseur defini par formatFichierIn
source=self.getSource(ulfile)
if source:
# On a reussia convertir le fichier self.ulfile
self.appliEficas.code=self.code
else :
self.readercata=self.appliEficas.readercata
- if self.readercata.ficCata == None : return #Sortie Salome
+ if self.readercata.fichierCata == None : return #Sortie Salome
self.titre=self.readercata.titre
- self.format = self.appliEficas.format_fichier
- self.format_in = self.appliEficas.format_fichier_in
+ self.formatFichierOut = self.appliEficas.formatFichierOut
+ self.formatFichierIn = self.appliEficas.formatFichierIn
if self.appliEficas.maConfiguration.dumpXSD==True : self.appliEficas.dumpXsd()
self.dict_reels={}
self.maConfiguration.mesGenerators = generator
self.maConfiguration.mesconvertisseurs = convert
+ try :
+ self.XMLGenerateur=generator.plugins['xml']()
+ except :
+ self.XMLGenerateur=None
- if self.format in generator.plugins.keys():
- self.generator = generator.plugins[self.format]()
+ if self.formatFichierOut in generator.plugins.keys():
+ self.generator = generator.plugins[self.formatFichierOut]()
self.fileInfo = None
jdcName=os.path.basename(fn)
# Il faut convertir le contenu du fichier en fonction du format
- if self.appliEficas.format_fichier_in in convert.plugins:
+ if self.appliEficas.formatFichierIn in convert.plugins:
# Le convertisseur existe on l'utilise
- p=convert.plugins[self.appliEficas.format_fichier_in]()
+ p=convert.plugins[self.appliEficas.formatFichierIn]()
p.readfile(fn)
if p.text=="" : self.nouveau=1
else :
self.afficheInfos("Type de fichier non reconnu",'red')
self.informe( "Type de fichier non reconnu",
- "EFICAS ne sait pas ouvrir le type de fichier " + self.appliEficas.format_fichier_in)
+ "EFICAS ne sait pas ouvrir le type de fichier " + self.appliEficas.formatFichierIn)
return None
CONTEXT.unsetCurrentStep()
#-----------------------#
# Il faut convertir le contenu du fichier en fonction du format
- if self.format in convert.plugins :
+ if self.formatFichierIn in convert.plugins :
# Le convertisseur existe on l'utilise
- p=convert.plugins[self.format]()
+ p=convert.plugins[self.formatFichierIn]()
p.readfile(file)
text=p.convert('execnoparseur')
if not p.cr.estvide():
# Il n'existe pas c'est une erreur
self.afficheInfos("Type de fichier non reconnu",'red')
self.informe( "Type de fichier non reconnu",
- "EFICAS ne sait pas ouvrir le type de fichier " + self.appliEficas.format_fichier_in)
+ "EFICAS ne sait pas ouvrir le type de fichier " + self.appliEficas.formatFichierIn)
return None
#----------------------------------------------#
#-----------------------#
def viewJdcPy(self):
#-----------------------#
- strSource = str( self.getTextJDC(self.format) )
+ strSource = str( self.getTextJDC(self.formatFichierOut) )
self._viewText(strSource, "JDC_RESULTAT")
#-----------------------#
fn = str(fn)
if txt == None :
- txt = self.getTextJDC(self.format,formatLigne=formatLigne)
+ txt = self.getTextJDC(self.formatFichierOut,formatLigne=formatLigne)
eol = '\n'
if len(txt) >= len(eol):
if txt[-len(eol):] != eol:
print('Sauvegarde du Fichier', 'Le fichier'+str(fn) + 'n a pas pu etre sauvegarde :' , str(why))
self.afficheInfos('Le fichier'+str(fn) + 'n a pas pu etre sauvegarde ' , 'red')
return 0
+
#-----------------------------------------------------------#
def getTextJDC(self,format = None,pourRun=0,formatLigne="beautifie"):
#-----------------------------------------------------------#
if self.code == "MAP" and not(format in generator.plugins): format = "MAP"
- if format == None : format = self.format
+ if format == None : format = self.formatFichierOut
if format in generator.plugins:
# Le generateur existe on l'utilise
dico=self.generator.Dico
return dico
else :
- self.afficheInfos(tr("Format %s non reconnu" , self.format),'red')
+ self.afficheInfos(tr("Format %s non reconnu" , 'Dictionnaire Imbrique' ),'red')
return ""
#-----------------------------------------#
def chercheDico(self):
#-----------------------------------------#
dicoCourant={}
- format = self.appliEficas.format_fichier
+ format = self.appliEficas.formatFichierOut
if format in generator.plugins:
# Le generateur existe on l'utilise
self.generator=generator.plugins[format]()
res=app.exec_()
sys.exit(res)
-def getEficasSsIhm(code=None, multi=False, langue='en', labelCode=None):
-#------------------------------------------------------------------------
+def getEficasSsIhm(code=None, multi=False, langue='en', labelCode=None,forceXML=False):
+#-------------------------------------------------------------------------------------
"""
Lance l'appli EFICAS sans Ihm
"""
from Editeur import session
options = session.parse(sys.argv)
if options.code != None : code=options.code
+ if forceXML : options.withXSD=True
from InterfaceQT4.qtEficasSsIhm import AppliSsIhm
Eficas=AppliSsIhm(code=code, salome=0, multi=multi, langue=langue, labelCode=labelCode)
print ('comm file is needed')
return
- monEficasSsIhm = getEficasSsIhm(code=options.code)
+ monEficasSsIhm = getEficasSsIhm(code=options.code, forceXML=True)
from .editorSsIhm import JDCEditorSsIhm
monEditeur=JDCEditorSsIhm(monEficasSsIhm,fichier)
fichierXML=fichier[:fichier.rfind(".")]+'.xml'
- monEditeur.saveFile(fichierXML)
- monEditeur.generator.writeDefault(fichierXML)
+ monEditeur.XMLGenerateur.gener(monEditeur.jdc)
+ monEditeur.XMLGenerateur.writeDefault(fichierXML)
sys.path.append(rep)
from Adao import prefs
from Adao import prefs_Adao
- #if hasattr(prefsCode,'encoding'):
- # Hack pour changer le codage par defaut des strings
- #import sys
- #reload(sys)
- #sys.setdefaultencoding(prefsCode.encoding)
- #del sys.setdefaultencoding
- # Fin hack
from Editeur import import_code
from Editeur import session
self.repIcon=os.path.join( os.path.dirname(os.path.abspath(__file__)),'..','Editeur','icons')
self.fichierCata=session.d_env.fichierCata
+ if session.d_env.labelCode : self.labelCode=session.d_env.labelCode
+ self.withXSD=session.d_env.withXSD
if self.salome:
import Accas
if ssCode != None :
- self.format_fichier= ssCode #par defaut
- prefsCode.NAME_SCHEME=ssCode
+ self.formatFichierOut = ssCode #par defaut
+ prefsCode.NAME_SCHEME = ssCode
else :
- self.format_fichier="python" #par defaut
+ self.formatFichierIn = "python" #par defaut
+ self.formatFichierOut = "python" #par defaut
nameConf='configuration_'+self.code
try :
from builtins import object
except : pass
-#import os,sys,py_compile
import os, sys
# Modules Eficas
class ReaderCataCommun(object):
#-------------------------------
- def askChoixCatalogue(self, cata_choice_list):
+ def askChoixCatalogue(self, cataListeChoix):
# ____________________________________________
"""
Ouvre une fenetre de selection du catalogue dans le cas où plusieurs
title=tr("Choix d une version ")
from InterfaceQT4.monChoixCata import MonChoixCata
- widgetChoix = MonChoixCata(self.appliEficas, [cata.user_name for cata in cata_choice_list], title)
+ widgetChoix = MonChoixCata(self.appliEficas, [cata.labelCode for cata in cataListeChoix], title)
ret=widgetChoix.exec_()
lab+=str(self.code)
lab+=tr(" avec le catalogue ")
if ret == QDialog.Accepted:
- cata = cata_choice_list[widgetChoix.CBChoixCata.currentIndex()]
- self.ficCata = cata.cata_file_path
- self.labelCode = cata.identifier
- self.appliEficas.format_fichier = cata.file_format
- self.appliEficas.format_fichier_in = cata.file_format_in
+ cata = cataListeChoix[widgetChoix.CBChoixCata.currentIndex()]
+ self.fichierCata = cata.fichierCata
+ self.labelCode = cata.labelCode
+ self.appliEficas.formatFichierOut = cata.formatFichierOut
+ self.appliEficas.formatFichierIn = cata.formatFichierIn
lab+=self.labelCode
self.appliEficas.setWindowTitle(lab)
- #qApp.mainWidget().setCaption(lab)
widgetChoix.close()
else:
widgetChoix.close()
# ____________________
- liste_cata_possibles=[]
+ listeCataPossibles=[]
self.Commandes_Ordre_Catalogue=[]
- all_cata_list = []
+ listeTousLesCatas = []
for catalogue in self.appliEficas.maConfiguration.catalogues:
- if isinstance(catalogue, CatalogDescription): all_cata_list.append(catalogue)
- elif isinstance(catalogue, tuple) : all_cata_list.append(CatalogDescription.create_from_tuple(catalogue))
+ if isinstance(catalogue, CatalogDescription): listeTousLesCatas.append(catalogue)
+ elif isinstance(catalogue, tuple) : listeTousLesCatas.append(CatalogDescription.createFromTuple(catalogue))
else: print(("Catalog description cannot be interpreted: ", catalogue))
# This filter is only useful for codes that have subcodes (like MAP).
# Otherwise, the "code" attribute of the catalog description can (should) be None.
- if self.ssCode is None: liste_cata_possibles = all_cata_list
+ if self.ssCode is None: listeCataPossibles = listeTousLesCatas
else:
- for catalogue in all_cata_list:
- if catalogue.code == self.code and catalogue.file_format == self.ssCode: liste_cata_possibles.append(catalogue)
+ for catalogue in listeTousLesCatas:
+ if catalogue.code == self.code and catalogue.ssCode == self.ssCode: listeCataPossibles.append(catalogue)
- # souci : c est pour la version
+ # le catalogue est fixe dans la ligne de commande
if self.appliEficas.fichierCata != None :
- for catalogue in all_cata_list:
- if os.path.abspath(catalogue.cata_file_path) == (os.path.abspath(self.appliEficas.fichierCata)) :
- liste_cata_possibles=(catalogue,)
+ trouve=False
+ for catalogue in listeTousLesCatas:
+ if os.path.abspath(catalogue.fichierCata) == (os.path.abspath(self.appliEficas.fichierCata)) :
+ listeCataPossibles=(catalogue,)
+ trouve=True
break
+ if not trouve:
+ catalogue=CatalogDescription.createFromTuple((self.code ,self.code,self.appliEficas.fichierCata,'python','python'))
+ listeCataPossibles=(catalogue,)
- if len(liste_cata_possibles)==0:
+ if len(listeCataPossibles)==0:
try :
from PyQt5.QtWidgets import QMessageBox, QDialog
QMessageBox.critical(self.QWParent, tr("Import du catalogue"),
return
+ # le label est fixe dans la ligne de commande
if self.labelCode is not None:
# La version a ete fixee
- for cata in liste_cata_possibles:
- if self.labelCode == cata.identifier:
- self.ficCata = cata.cata_file_path
- self.appliEficas.format_fichier = cata.file_format
- self.appliEficas.format_fichier_in = cata.file_format_in
+ for cata in listeCataPossibles:
+ if self.labelCode == cata.labelCode:
+ self.fichierCata = cata.fichierCata
+ self.appliEficas.formatFichierIn = cata.formatFichierIn
+ self.appliEficas.formatFichierOut = cata.formatFichierOut
else:
- cata_choice_list = []
- for cata in liste_cata_possibles:
- if cata.selectable:
- if cata.default : cata_choice_list.insert(0, cata)
- else : cata_choice_list.append(cata)
+ cataListeChoix = []
+ for cata in listeCataPossibles:
+ if cata.default : cataListeChoix.insert(0, cata)
+ else : cataListeChoix.append(cata)
- if len(cata_choice_list) == 0:
+ if len(cataListeChoix) == 0:
try :
from PyQt5.QtWidgets import QMessageBox
QMessageBox.critical(self.QWParent, tr("Import du catalogue"),
self.appliEficas.close()
if self.appliEficas.salome == 0 : sys.exit(1)
- elif len(cata_choice_list) == 1:
- self.ficCata = cata_choice_list[0].cata_file_path
- self.labelCode = cata_choice_list[0].identifier
- self.appliEficas.format_fichier = cata_choice_list[0].file_format
- self.appliEficas.format_fichier_in = cata_choice_list[0].file_format_in
+ elif len(cataListeChoix) == 1:
+ self.fichierCata = cataListeChoix[0].fichierCata
+ self.labelCode = cataListeChoix[0].labelCode
+ self.appliEficas.formatFichierOut = cataListeChoix[0].formatFichierOut
+ self.appliEficas.formatFichierIn = cataListeChoix[0].formatFichierIn
else:
# plusieurs catalogues sont disponibles : il faut demander a l'utilisateur
if self.appliEficas.ssIhm :
print ('Unable to know which catafile is choosen')
exit()
- self.askChoixCatalogue(cata_choice_list)
+ self.askChoixCatalogue(cataListeChoix)
self.demandeCatalogue=True
- if self.ficCata == None :
+ if self.fichierCata == None :
if self.appliEficas.salome == 0 :
print(("Pas de catalogue pour code %s, version %s" %(self.code,self.labelCode)))
sys.exit(1)
self.demandeCatalogue=False
self.code=self.appliEficas.code
self.ssCode=self.appliEficas.ssCode
- self.appliEficas.format_fichier='python'
+ # on positionne par defaut mais est-ce vraiment necessaire
+ self.appliEficas.formatFichierIn='python'
+ self.appliEficas.formatFichierOut='python'
self.labelCode=self.appliEficas.labelCode
- self.ficCata=None
+ self.fichierCata=self.appliEficas.fichierCata
self.openCata()
self.traiteIcones()
self.cataitem=None
# import du catalogue
self.choisitCata()
- if self.appliEficas.maConfiguration.withXSD :
+ if self.appliEficas.maConfiguration.withXSD or self.appliEficas.withXSD :
try :
- nomCataXsd = os.path.splitext(os.path.basename(self.ficCata))[0]+'_genere'
- fichierCataTrunc=os.path.splitext(os.path.basename(self.ficCata))[0]
+ nomCataXsd = os.path.splitext(os.path.basename(self.fichierCata))[0]
+ fichierCataTrunc=os.path.splitext(os.path.basename(self.fichierCata))[0]
#if fichierCataTrunc[0:4] in ('cata','Cata'): fichierCataTrunc=fichierCataTrunc[4:]
#if fichierCataTrunc[0] in ('_','-') : fichierCataTrunc=fichierCataTrunc[1:]
nomCataXsd = fichierCataTrunc+'_driver'
- pathCata = os.path.dirname(self.ficCata)+'/raw/'+nomCataXsd+'.py'
-# modeleMetier=__import__('raw.cata_DPD_genere',fromlist=[''])
+ pathCata = os.path.dirname(self.fichierCata)+'/raw/'+nomCataXsd+'.py'
import imp
modeleMetier= imp.load_source(nomCataXsd,pathCata)
#print ('_________________________', modeleMetier)
else :
modeleMetier = None
- self.cata = self.importCata(self.ficCata)
+ self.cata = self.importCata(self.fichierCata)
if hasattr(self.cata, 'implement'): self.cata.JdC.implement = self.cata.implement
else : self.cata.JdC.implement = ""
if hasattr(self.cata, 'importedBy'): self.cata.JdC.importedBy = self.cata.importedBy
if not self.cata :
try:
from PyQt5.QtWidgets import QMessageBox, QDialog
- QMessageBox.critical( self.QWParent, tr("Import du catalogue"),tr("Impossible d'importer le catalogue ")+ self.ficCata)
+ QMessageBox.critical( self.QWParent, tr("Import du catalogue"),tr("Impossible d'importer le catalogue ")+ self.fichierCata)
except :
- print ("Impossible d'importer le catalogue "+ self.ficCata)
+ print ("Impossible d'importer le catalogue "+ self.fichierCata)
self.appliEficas.close()
if self.appliEficas.salome == 0 :
sys.exit(1)
# traitement des clefs documentaires
#
- self.titre=self.VERSION_EFICAS+" "+tr( " avec le catalogue ") + os.path.basename(self.ficCata)
+ self.titre=self.VERSION_EFICAS+" "+tr( " avec le catalogue ") + os.path.basename(self.fichierCata)
if self.appliEficas.ssIhm == False : self.appliEficas.setWindowTitle(self.titre)
self.appliEficas.titre=self.titre
self.QWParent.titre=self.titre
Retrouve l'ordre des mots-cles dans le catalogue, cad :
Attention s appuie sur les commentaires
"""
- nom_cata = os.path.splitext(os.path.basename(self.ficCata))[0]
- rep_cata = os.path.dirname(self.ficCata)
- self.Commandes_Ordre_Catalogue = analyse_catalogue_initial.analyseCatalogue(self.ficCata)
+ nom_cata = os.path.splitext(os.path.basename(self.fichierCata))[0]
+ rep_cata = os.path.dirname(self.fichierCata)
+ self.Commandes_Ordre_Catalogue = analyse_catalogue_initial.analyseCatalogue(self.fichierCata)
#print self.Commandes_Ordre_Catalogue
def traiteIcones(self):
self.VERSION_EFICAS=self.appliEficas.VERSION_EFICAS
self.code=self.appliEficas.code
self.ssCode=self.appliEficas.ssCode
- self.appliEficas.format_fichier='python'
- self.appliEficas.format_fichier_in ='xml'
+ # PN ?? bizarre le 22/04/20
+ self.appliEficas.formatfichierOut='python'
+ self.appliEficas.formatfichierIn ='xml'
self.modeNouvCommande=self.appliEficas.maConfiguration.modeNouvCommande
self.labelCode=self.appliEficas.labelCode
self.version_cata=None
--- /dev/null
+#!/usr/bin/env python
+# -*- 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
+#
+"""
+""
+ cree le .xml associe au .comm
+ generateXML.py -c leCatalogue le.comm
+
+"""
+# Modules Python
+# Modules Eficas
+
+import sys
+import os
+sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../'))
+
+from InterfaceQT4 import eficas_go
+eficas_go.genereXML(code='NonConnu')
--- /dev/null
+#!/usr/bin/env python
+# -*- 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
+#
+"""
+ Ce module sert a lancer EFICAS contre l avis de Pascale sans directory associee
+ Dans ce cas on peut taper
+ a) de n importe ou sans avoir rien positionne :
+ /leCheminVersTools/qtEficasGui.py -c leFichierCatalogueAvecSonPathComplet
+ b) En ayant positionne le PYTHONPATH avec la directory qui contient ce qu il faut
+ c est a dire le prefs.py et prefs_leCode.py
+ exemple pour Adao
+ /leCheminVersTools/qtEficasGui.py -k Adao
+ /leCheminVersTools/qtEficasGui.py -k Adao -v V95
+
+"""
+# Modules Python
+# Modules Eficas
+
+import sys
+import os
+
+repIni=os.path.dirname(os.path.abspath(__file__))
+INSTALLDIR=os.path.join(repIni,'..')
+sys.path[:0]=[INSTALLDIR]
+#sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../..'))
+
+from InterfaceQT4 import eficas_go
+eficas_go.lanceEficas(code='NonConnu')
import types,re,os
from Extensions.i18n import tr
from .generator_dicoImbrique import DicoImbriqueGenerator
-import pdb
def entryPoint():
"""
def gener(self,obj,format='brut',config=None,appliEficas=None):
try :
+ #if 1 :
self.texteXML=obj.toXml()
except :
self.texteXML='erreur generation'
- pass
+ # pass
self.textePourAide =""
self.dictNbNomObj={}