Salome HOME
pour PSEN et Telemac
[tools/eficas.git] / generator / generator_ProcessOutputs.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2007-2013   EDF R&D
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20 """Ce module contient le plugin generateur de fichier au format  Code_Carmel3D pour EFICAS.
21 """
22
23 import types,string,re,os
24 from Extensions.i18n import tr
25 from generator_python import PythonGenerator
26 from generator_modification import ModificationGenerator
27 from numpy import zeros
28
29 def entryPoint():
30    """
31       Retourne les informations necessaires pour le chargeur de plugins
32       Ces informations sont retournees dans un dictionnaire
33    """
34    return {
35         # Le nom du plugin
36           'name' : 'ProcessOutputs',
37         # La factory pour creer une instance du plugin
38           'factory' : ProcessOutputsGenerator,
39           }
40
41
42 class ProcessOutputsGenerator(PythonGenerator,ModificationGenerator):
43    """
44       Ce generateur parcourt un objet de type JDC et produit
45       un texte au format eficas et 
46       un texte au format dictionnaire
47
48    """
49    # Les extensions de fichier permis?
50    extensions=('.comm',)
51
52 #----------------------------------------------------------------------------------------
53    def gener(self,obj,format='brut',config=None, appli=None):
54
55       # Cette instruction genere le contenu du fichier de commandes (persistance)
56       texteModification=self.generTexteModif(obj)
57       text=PythonGenerator.gener(self,obj,format)
58       self.text=texteModification+text
59
60       return self.text
61
62
63   
64 # si repertoire on change tous les noms de fichier