gtkdoc: remove unused imports
[gtk-doc.git] / gtkdoc / mkman.py
blob2a9ecb50d908f8fe5d83855940054c7153608d00
1 # -*- python; coding: utf-8 -*-
3 # gtk-doc - GTK DocBook documentation generator.
4 # Copyright (C) 1998 Owen Taylor
5 # 2001-2005 Damon Chaplin
6 # 2009-2017 Stefan Sauer
7 # 2017 Jussi Pakkanen
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 import os
25 import sys
26 import argparse
27 import subprocess
28 from glob import glob
30 from . import config
33 def run(options):
34 module = options.args[0]
35 document = options.args[1]
36 if options.verbose:
37 quiet = '0'
38 else:
39 quiet = '1'
41 if options.uninstalled:
42 # TODO: this does not work from buiddir!=srcdir
43 gtkdocdir = os.path.split(sys.argv[0])[0]
44 else:
45 gtkdocdir = os.path.join(config.datadir, 'gtk-doc/data')
47 # we could do "$path_option $PWD " to avoid needing rewriting entities that
48 # are copied from the header into docs under xml
49 if options.path == '':
50 path_arg = []
51 else:
52 path_arg = [path_option, options.path]
54 # would it make sense to create man pages only for certain refentries
55 # e.g. for tools
56 # see http://bugzilla.gnome.org/show_bug.cgi?id=467488
57 return subprocess.call([config.xsltproc] + path_arg + [
58 '--nonet',
59 '--xinclude',
60 '--stringparam',
61 'gtkdoc.bookname',
62 module,
63 '--stringparam',
64 'gtkdoc.version',
65 config.version,
66 '--stringparam',
67 'chunk.quietly ',
68 quiet,
69 '--stringparam',
70 'chunker.output.quiet',
71 quiet,
72 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
73 document])