# -*- coding: utf-8 -*-
-# CONFIGURATION MANAGEMENT OF EDF VERSION
-# ======================================================================
-# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
-# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
-# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
-# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
-# (AT YOUR OPTION) ANY LATER VERSION.
+# Copyright (C) 2007-2013 EDF R&D
#
-# THIS PROGRAM 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
-# GENERAL PUBLIC LICENSE FOR MORE DETAILS.
+# 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.
#
-# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
-# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
-# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
+# 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 contient le plugin generateur de fichier au format
python pour EFICAS.
PN
"""
+from __future__ import absolute_import
+from __future__ import print_function
+from __future__ import division
+try :
+ from builtins import range
+except :
+ pass
import traceback
-import types,string,re
+import types,re
import math
from Noyau import N_CR
import Accas
import Extensions
from Extensions.parametre import ITEM_PARAMETRE
-from Formatage import Formatage
-from generator_python import PythonGenerator
+from .Formatage import Formatage
+from .generator_python import PythonGenerator
+from six.moves import range
#from Editeur.widgets import showerror
def entryPoint():
"""
- Retourne les informations nécessaires pour le chargeur de plugins
+ Retourne les informations necessaires pour le chargeur de plugins
- Ces informations sont retournées dans un dictionnaire
+ Ces informations sont retournees dans un dictionnaire
"""
return {
# Le nom du plugin
'name' : 'vers3DSalome',
- # La factory pour créer une instance du plugin
+ # La factory pour creer une instance du plugin
'factory' : vers3DSalomeGenerator,
}
"POUTRE", "SECTION", "VALE", "VARI_SECT",
"GRILLE", "ANGL_REP", "VECTEUR",
"b_constant", "b_homothetique",
- "b_rectangle", "b_affine", "b_cercle" )
+ "b_rectangle", "b_affine", "b_cercle", "b_generale" )
self.dict_deb_com={"POUTRE":"VisuPoutre", "CABLE" : "VisuCable",
"COQUE" : "VisuCoque", "GRILLE" : "VisuGrille",
"ORIENTATION" : "Orientation", "BARRE" : "VisuBarre"}
self.commande = ""
self.dict_attributs = {}
- def gener(self,node,config=None):
+ def gener(self,node,config=None,appli=None):
"""
"""
self.node=node
self.list_commandes=[];
self.generator(self.node.object)
- #print self.list_commandes
return self.list_commandes
def generator(self,obj):
"""
"""
if obj.isvalid() == 0 :
- #showerror("Element non valide","Salome ne sait pas traiter les élements non valides")
+ #showerror("Element non valide","Salome ne sait pas traiter les elements non valides")
+ return
+ for v in obj.mc_liste:
+ liste=self.generator(v)
+
+ def generMACRO_ETAPE(self,obj):
+ """
+ """
+ if obj.isvalid() == 0 :
+ #showerror("Element non valide","Salome ne sait pas traiter les elements non valides")
return
for v in obj.mc_liste:
liste=self.generator(v)
def generMCFACT(self,obj):
"""
- Convertit un objet MCFACT en une liste de chaines de caractères à la
+ Convertit un objet MCFACT en une liste de chaines de caracteres a la
syntaxe python
"""
self.init_ligne()
self.list_commandes.append((self.commande,self.dict_attributs))
else :
#showerror("Elements ne portant pas sur un Groupe de Maille","Salome ne sait pas montrer ce type d' element")
- print ("Elements ne portant pas sur un Groupe de Maille","Salome ne sait pas montrer ce type d' element")
+ print(("Elements ne portant pas sur un Groupe de Maille","Salome ne sait pas montrer ce type d' element"))
pass
def generMCList(self,obj):
def CARA(self,obj) :
self.clefs=obj.val
- if type(self.clefs) == types.StringType :
+ if type(self.clefs) == bytes :
self.clefs=(obj.val,)
def VALE(self,obj) :
for k in range(len(atraiter)) :
clef=self.clefs[k]
val =atraiter[k]
+ if isinstance(val, (tuple, list)) and len(val) == 1:
+ val = val[0]
if isinstance (val, Extensions.parametre.PARAMETRE):
val=val.valeur
- print val.__class__
+ print(( val.__class))
context={}
if type(val) == type("aaa") :
for p in self.jdc.params:
context[p.nom]=eval(p.val,self.jdc.const_context, context)
- print context[p.nom]
+ print((context[p.nom]))
res=eval(val,self.jdc.const_context, context)
val=res
self.dict_attributs[clef]=val