Salome HOME
pb de check box
[tools/eficas.git] / convert / convert_python6.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 """
21     Ce module contient le plugin convertisseur de fichier
22     au format python pour EFICAS.
23
24     Un plugin convertisseur doit fournir deux attributs de classe :
25     extensions et formats et deux méthodes : readfile,convert.
26
27     L'attribut de classe extensions est une liste d'extensions
28     de fichiers préconisées pour ce type de format. Cette information
29     est seulement indicative.
30
31     L'attribut de classe formats est une liste de formats de sortie
32     supportés par le convertisseur. Les formats possibles sont :
33     eval, dict ou exec.
34     Le format eval est un texte source Python qui peut etre evalué. Le
35     résultat de l'évaluation est un objet Python quelconque.
36     Le format dict est un dictionnaire Python.
37     Le format exec est un texte source Python qui peut etre executé. 
38
39     La méthode readfile a pour fonction de lire un fichier dont le
40     nom est passé en argument de la fonction.
41        - convertisseur.readfile(nom_fichier)
42
43     La méthode convert a pour fonction de convertir le fichier
44     préalablement lu dans un objet du format passé en argument.
45        - objet=convertisseur.convert(outformat)
46
47     Ce convertisseur supporte le format de sortie exec
48
49 """
50 def entryPoint():
51    """
52        Retourne les informations nécessaires pour le chargeur de plugins
53        Ces informations sont retournées dans un dictionnaire
54    """
55    return {
56         # Le nom du plugin
57           'name' : 'python6',
58         # La factory pour créer une instance du plugin
59           'factory' : PythonParser,
60           }
61
62 from convert_python import PythonParser