From d2d13736dad395d1d75c3ee8fc0d9adda5b02e17 Mon Sep 17 00:00:00 2001 From: "pascale.noyret" Date: Fri, 10 May 2019 18:56:10 +0200 Subject: [PATCH] pour generer un xml a partir d un comm --- InterfaceQT4/eficas_go.py | 15 +++++++++++++++ Vimmp/generateXML.py | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100755 Vimmp/generateXML.py diff --git a/InterfaceQT4/eficas_go.py b/InterfaceQT4/eficas_go.py index 96be6965..9a375d6d 100755 --- a/InterfaceQT4/eficas_go.py +++ b/InterfaceQT4/eficas_go.py @@ -93,6 +93,21 @@ def genereXSD(code=None,fichier=None,ssCode=None,multi=False,langue='en',debug=T f = open( str(fileXSD), 'w') f.write(str(texteXSD)) +def genereXML(code=None,fichier=None,ssCode=None,multi=False,langue='en',debug=True): + from Editeur import session + options=session.parse(sys.argv) + if options.code!= None : code=options.code + if options.ssCode!= None : ssCode=options.ssCode + if fichier==None : fichier=options.comm[0] + if options.cata == None : + print ('Use -c cata_name.py') + return + monEficasSsIhm = getEficasSsIhm(code=code, fichierCata=options.cata) + from .editorSsIhm import JDCEditorSsIhm + monEditeur=JDCEditorSsIhm(monEficasSsIhm,fichier) + fichierXML=fichier[:fichier.rfind(".")]+'.xml' + monEditeur.saveFile(fichierXML) + print (fichierXML) def lanceEficas_ssIhm(code=None,fichier=None,ssCode=None,version=None,debug=False,langue='en'): diff --git a/Vimmp/generateXML.py b/Vimmp/generateXML.py new file mode 100755 index 00000000..d8fd33dd --- /dev/null +++ b/Vimmp/generateXML.py @@ -0,0 +1,36 @@ +#!/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 configure pour Meteo +""" +# Modules Python +# Modules Eficas +import prefs +name='prefs_'+prefs.code +__import__(name) + +import sys +import os +sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../..')) + +import prefs +from InterfaceQT4 import eficas_go +eficas_go.genereXML(code=prefs.code) -- 2.39.2