2 #-------------------------------------------------------------------------------
4 # | ____| _| |_ / __ \ /\ | \/ |
5 # | |__ _ __ ___ ___ / \| | | | / \ | \ / |
6 # | __| '__/ _ \/ _ ( (| |) ) | | |/ /\ \ | |\/| |
7 # | | | | | __/ __/\_ _/| |__| / ____ \| | | |
8 # |_| |_| \___|\___| |_| \____/_/ \_\_| |_|
10 # FreeFOAM: The Cross-Platform CFD Toolkit
12 # Copyright (C) 2008-2010 Michael Wild <themiwi@users.sf.net>
13 # Gerber van der Graaf <gerber_graaf@users.sf.net>
14 #-------------------------------------------------------------------------------
16 # This file is part of FreeFOAM.
18 # FreeFOAM is free software; you can redistribute it and/or modify it
19 # under the terms of the GNU General Public License as published by the
20 # Free Software Foundation; either version 2 of the License, or (at your
21 # option) any later version.
23 # FreeFOAM is distributed in the hope that it will be useful, but WITHOUT
24 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
25 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
28 # You should have received a copy of the GNU General Public License
29 # along with FreeFOAM; if not, write to the Free Software Foundation,
30 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
36 # Extracts the brief description from the header comment of an application
37 # source file and converts it to AsciiDoc code. The output is written to
40 #------------------------------------------------------------------------------
42 """Usage: extractBrief@PY_SCRIPT_SUFFIX@ <name> <file>
44 Extracts the brief description from the header comment of an application
45 source file and converts it to AsciiDoc code. The output is written to
51 -help Display this help message
52 <name> Name of the application.
53 <file> The source file to to process.
59 sys
.path
.insert(0, '@FOAM_PYTHON_DIR@')
60 import FreeFOAM
.doxyToAsciidoc
61 from FreeFOAM
.compat
import *
66 if a
== '-h' or a
== '-help':
73 echo('Error: the name and input file required arguments', file=sys
.stderr
)
79 if not os
.path
.isfile(source
):
80 echo('Error: "%s" does not exist or is not a file'%source, file=sys
.stderr
)
83 # parse the header comments
84 doc
= FreeFOAM
.doxyToAsciidoc
.Parser(source
).parse()
85 brief
= ' '.join(doc
['brief']).strip()
89 echo('*linkff:%s[1]*::\n %s'%(name
, brief
))
91 # ------------------------- vim: set sw=3 sts=3 et: --------------- end-of-file