1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2007-2013 EDF R&D
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.
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.
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
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 Ce module contient le plugin convertisseur de fichier
22 au format python pour EFICAS.
24 Un plugin convertisseur doit fournir deux attributs de classe :
25 extensions et formats et deux méthodes : readfile,convert.
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.
31 L'attribut de classe formats est une liste de formats de sortie
32 supportés par le convertisseur. Les formats possibles sont :
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é.
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)
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)
47 Ce convertisseur supporte le format de sortie exec
52 Retourne les informations nécessaires pour le chargeur de plugins
53 Ces informations sont retournées dans un dictionnaire
58 # La factory pour créer une instance du plugin
59 'factory' : PythonParser,
62 from convert_python import PythonParser