X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=Editeur%2Fautre_analyse_cata.py;h=d6411f7cd0e5ab98349208533c3bba8f5965efb2;hb=9f4ff7ed9afd87c96e11d61e442e39e5511f60d1;hp=69ac18881d526910d095a291b41b893827115461;hpb=cdd358f4041f957701ac10d86766a85baaef4f78;p=tools%2Feficas.git diff --git a/Editeur/autre_analyse_cata.py b/Editeur/autre_analyse_cata.py index 69ac1888..d6411f7c 100644 --- a/Editeur/autre_analyse_cata.py +++ b/Editeur/autre_analyse_cata.py @@ -1,27 +1,28 @@ # -*- 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 sert a retrouver l'ordre des mots cles d'un catalogue de commandes """ +from __future__ import absolute_import +from __future__ import print_function if __name__ == "__main__" : import sys sys.path[:0]=[".."] @@ -43,13 +44,13 @@ def traite_entite(entite,liste_simp_reel): Cette fonction ajoute a l'objet entite un attribut de nom ordre_mc qui est une liste contenant le nom des sous entites dans l'ordre de leur apparition dans le catalogue. - L'ordre d'apparition dans le catalogue est donné par l'attribut _no + L'ordre d'apparition dans le catalogue est donne par l'attribut _no de l'entite La fonction active le meme type de traitement pour les sous entites de entite """ l=[] - for k,v in entite.entites.items(): + for k,v in list(entite.entites.items()): if isinstance(v,NUPL): traite_entiteNUPL(v) else: @@ -93,16 +94,15 @@ def analyse_niveau(cata_ordonne_dico,niveau,liste_simp_reel): def analyse_catalogue(cata): """ Cette fonction analyse le catalogue cata pour construire avec l'aide - de traite_entite la structure de données ordre_mc qui donne l'ordre - d'apparition des mots clés dans le catalogue + de traite_entite la structure de donnees ordre_mc qui donne l'ordre + d'apparition des mots cles dans le catalogue Elle retourne un dictionnaire qui contient toutes les commandes - du catalogue indexées par leur nom + du catalogue indexees par leur nom """ cata_ordonne_dico={} liste_simp_reel=[] if cata.JdC.l_niveaux == (): # Il n'y a pas de niveaux - a=1 for oper in cata.JdC.commandes: traite_entite(oper,liste_simp_reel) cata_ordonne_dico[oper.nom]=oper @@ -119,11 +119,11 @@ if __name__ == "__main__" : #dico=analyse_catalogue(cata_saturne) def print_entite(entite,dec=' '): - print dec,entite.nom,entite.__class__.__name__ + print (dec,entite.nom,entite.__class__.__name__) for mocle in entite.ordre_mc: print_entite(entite.entites[mocle],dec=dec+' ') - for k,v in dico.items(): + for k,v in list(dico.items()): print_entite(v,dec='') - print dico.keys() + print (dico)