1 # -*- coding: utf-8 -*-
2 # CONFIGURATION MANAGEMENT OF EDF VERSION
3 # ======================================================================
4 # COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
5 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
6 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
7 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
8 # (AT YOUR OPTION) ANY LATER VERSION.
10 # THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
11 # WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
12 # MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
13 # GENERAL PUBLIC LICENSE FOR MORE DETAILS.
15 # YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
16 # ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
17 # 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
20 # ======================================================================
22 Ce module contient le plugin convertisseur de fichier
23 au format python pour EFICAS.
25 Un plugin convertisseur doit fournir deux attributs de classe :
26 extensions et formats et deux méthodes : readfile,convert.
28 L'attribut de classe extensions est une liste d'extensions
29 de fichiers préconisées pour ce type de format. Cette information
30 est seulement indicative.
32 L'attribut de classe formats est une liste de formats de sortie
33 supportés par le convertisseur. Les formats possibles sont :
35 Le format eval est un texte source Python qui peut etre evalué. Le
36 résultat de l'évaluation est un objet Python quelconque.
37 Le format dict est un dictionnaire Python.
38 Le format exec est un texte source Python qui peut etre executé.
40 La méthode readfile a pour fonction de lire un fichier dont le
41 nom est passé en argument de la fonction.
42 - convertisseur.readfile(nom_fichier)
44 La méthode convert a pour fonction de convertir le fichier
45 préalablement lu dans un objet du format passé en argument.
46 - objet=convertisseur.convert(outformat)
48 Ce convertisseur supporte le format de sortie exec
53 Retourne les informations nécessaires pour le chargeur de plugins
54 Ces informations sont retournées dans un dictionnaire
59 # La factory pour créer une instance du plugin
60 'factory' : PythonParser,
63 from convert_python import PythonParser