X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=doc%2Fsalome%2Fgui%2FSMESH%2Fcollect_mesh_methods.py;h=72fdb038234424ac6197d2df999a080b3c2670e9;hp=24fd31880739affeb4c7188241337096c1ec80f4;hb=3f1015c8e4812a798a6b179fbc05e8f78be9922b;hpb=f5016d85b7b4b88623723027a1585c6414c4dc66 diff --git a/doc/salome/gui/SMESH/collect_mesh_methods.py b/doc/salome/gui/SMESH/collect_mesh_methods.py index 24fd31880..72fdb0382 100755 --- a/doc/salome/gui/SMESH/collect_mesh_methods.py +++ b/doc/salome/gui/SMESH/collect_mesh_methods.py @@ -1,4 +1,24 @@ #!/usr/bin/env python +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE +# +# 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. +# +# 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 +# + ################################################################################# # # File: collect_mesh_methods.py @@ -28,10 +48,13 @@ import sys -def main(plugin, dummymeshhelp = True, output_file = "smesh.py"): - plugin_module = plugin + "DC" +def main(plugin_name, dummymeshhelp = True, output_file = "smeshBuilder.py"): + plugin_module_name = plugin_name + "Builder" + plugin_module = "salome.%s.%s" % (plugin_name, plugin_module_name) try: - mod = __import__(plugin_module) + exec( "from salome.smesh.smeshBuilder import *") + exec( "import %s" % plugin_module ) + exec( "mod = %s" % plugin_module ) methods = {} for attr in dir( mod ): if attr.startswith( '_' ): continue @@ -45,8 +68,8 @@ def main(plugin, dummymeshhelp = True, output_file = "smesh.py"): if methods: output = [] if dummymeshhelp: - output.append( "## @package smesh" ) - output.append( "# Documentation of the methods dynamically added by the " + plugin + " meshing plug-in to the Mesh class." ) + output.append( "## @package smeshBuilder" ) + output.append( "# Documentation of the methods dynamically added by the " + plugin_name + " meshing plug-in to the Mesh class." ) output.append( "" ) pass output.append( "## This class allows defining and managing a mesh." ) @@ -55,8 +78,8 @@ def main(plugin, dummymeshhelp = True, output_file = "smesh.py"): # Add dummy Mesh help # This is supposed to be done when generating documentation for meshing plug-ins output.append( "# @note The documentation below does not provide complete description of class @b %Mesh" ) - output.append( "# from @b %smesh.py package. This documentation provides only information about" ) - output.append( "# the methods dynamically added to the %Mesh class by the " + plugin + " plugin" ) + output.append( "# from @b smeshBuilder package. This documentation provides only information about" ) + output.append( "# the methods dynamically added to the %Mesh class by the " + plugin_name + " plugin" ) output.append( "# For more details on the %Mesh class, please refer to the SALOME %Mesh module" ) output.append( "# documentation." ) pass @@ -84,7 +107,7 @@ def main(plugin, dummymeshhelp = True, output_file = "smesh.py"): output.append( " # @param algo_type type of algorithm to be created; allowed values are specified by classes implemented by plug-in (see below)" ) output.append( " # @param geom_shape if defined, the subshape to be meshed (GEOM_Object)" ) output.append( " # @return An instance of Mesh_Algorithm sub-class according to the specified @a algo_type, see " ) - output.append( " # %s" % ", ".join( [ "%s.%s" % ( plugin_module, algo.__name__ ) for algo in methods[ method ] ] ) ) + output.append( " # %s" % ", ".join( [ "%s.%s" % ( plugin_module_name, algo.__name__ ) for algo in methods[ method ] ] ) ) output.append( " def %s(algo_type, geom_shape=0):" % method ) output.append( " pass" ) pass