Jörg Thalheim | 3e67e5c | 2017-05-01 02:26:56 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
Zbigniew Jędrzejewski-Szmek | e7098b6 | 2012-11-13 18:39:18 +0100 | [diff] [blame] | 2 | # -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ |
| 3 | # |
| 4 | # This file is part of systemd. |
| 5 | # |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 6 | # Copyright 2012-2013 Zbigniew Jędrzejewski-Szmek |
Zbigniew Jędrzejewski-Szmek | e7098b6 | 2012-11-13 18:39:18 +0100 | [diff] [blame] | 7 | # |
| 8 | # systemd is free software; you can redistribute it and/or modify it |
| 9 | # under the terms of the GNU Lesser General Public License as published by |
| 10 | # the Free Software Foundation; either version 2.1 of the License, or |
| 11 | # (at your option) any later version. |
| 12 | # |
| 13 | # systemd is distributed in the hope that it will be useful, but |
| 14 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 | # Lesser General Public License for more details. |
| 17 | # |
| 18 | # You should have received a copy of the GNU Lesser General Public License |
| 19 | # along with systemd; If not, see <http://www.gnu.org/licenses/>. |
| 20 | |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 21 | import sys |
| 22 | import collections |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 23 | import re |
Zbigniew Jędrzejewski-Szmek | 1c6c3ef | 2017-07-02 20:26:32 -0400 | [diff] [blame] | 24 | from xml_helper import xml_parse, xml_print, tree |
Zbigniew Jędrzejewski-Szmek | 827f70e | 2013-05-29 22:31:20 -0400 | [diff] [blame] | 25 | from copy import deepcopy |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 26 | |
| 27 | TEMPLATE = '''\ |
Zbigniew Jędrzejewski-Szmek | 56ba3c7 | 2013-02-02 22:47:47 -0500 | [diff] [blame] | 28 | <refentry id="systemd.directives" conditional="HAVE_PYTHON"> |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 29 | |
| 30 | <refentryinfo> |
| 31 | <title>systemd.directives</title> |
| 32 | <productname>systemd</productname> |
| 33 | |
| 34 | <authorgroup> |
| 35 | <author> |
| 36 | <contrib>Developer</contrib> |
| 37 | <firstname>Zbigniew</firstname> |
| 38 | <surname>Jędrzejewski-Szmek</surname> |
| 39 | <email>zbyszek@in.waw.pl</email> |
| 40 | </author> |
| 41 | </authorgroup> |
| 42 | </refentryinfo> |
| 43 | |
| 44 | <refmeta> |
| 45 | <refentrytitle>systemd.directives</refentrytitle> |
Zbigniew Jędrzejewski-Szmek | 9cc2c8b | 2013-01-14 22:08:33 -0500 | [diff] [blame] | 46 | <manvolnum>7</manvolnum> |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 47 | </refmeta> |
| 48 | |
| 49 | <refnamediv> |
| 50 | <refname>systemd.directives</refname> |
| 51 | <refpurpose>Index of configuration directives</refpurpose> |
| 52 | </refnamediv> |
| 53 | |
| 54 | <refsect1> |
| 55 | <title>Unit directives</title> |
| 56 | |
| 57 | <para>Directives for configuring units, used in unit |
| 58 | files.</para> |
| 59 | |
| 60 | <variablelist id='unit-directives' /> |
| 61 | </refsect1> |
Zbigniew Jędrzejewski-Szmek | e1abd3e | 2012-09-16 11:11:34 +0200 | [diff] [blame] | 62 | |
| 63 | <refsect1> |
Zbigniew Jędrzejewski-Szmek | 08177c8 | 2013-01-14 21:58:22 -0500 | [diff] [blame] | 64 | <title>Options on the kernel command line</title> |
| 65 | |
| 66 | <para>Kernel boot options for configuring the behaviour of the |
| 67 | systemd process.</para> |
| 68 | |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 69 | <variablelist id='kernel-commandline-options' /> |
Zbigniew Jędrzejewski-Szmek | 08177c8 | 2013-01-14 21:58:22 -0500 | [diff] [blame] | 70 | </refsect1> |
| 71 | |
| 72 | <refsect1> |
| 73 | <title>Environment variables</title> |
| 74 | |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 75 | <para>Environment variables understood by the systemd |
| 76 | manager and other programs.</para> |
Zbigniew Jędrzejewski-Szmek | 08177c8 | 2013-01-14 21:58:22 -0500 | [diff] [blame] | 77 | |
| 78 | <variablelist id='environment-variables' /> |
| 79 | </refsect1> |
| 80 | |
| 81 | <refsect1> |
Zbigniew Jędrzejewski-Szmek | e1abd3e | 2012-09-16 11:11:34 +0200 | [diff] [blame] | 82 | <title>UDEV directives</title> |
| 83 | |
| 84 | <para>Directives for configuring systemd units through the |
| 85 | udev database.</para> |
| 86 | |
| 87 | <variablelist id='udev-directives' /> |
| 88 | </refsect1> |
Zbigniew Jędrzejewski-Szmek | f6c2e28 | 2012-08-10 19:35:43 +0200 | [diff] [blame] | 89 | |
| 90 | <refsect1> |
Tom Gundersen | 1f06807 | 2013-11-10 19:33:18 +0100 | [diff] [blame] | 91 | <title>Network directives</title> |
| 92 | |
| 93 | <para>Directives for configuring network links through the |
Tom Gundersen | 46b0925 | 2013-11-10 20:52:53 +0100 | [diff] [blame] | 94 | net-setup-link udev builtin and networks through |
| 95 | systemd-networkd.</para> |
Tom Gundersen | 1f06807 | 2013-11-10 19:33:18 +0100 | [diff] [blame] | 96 | |
| 97 | <variablelist id='network-directives' /> |
| 98 | </refsect1> |
| 99 | |
| 100 | <refsect1> |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 101 | <title>Journal fields</title> |
Zbigniew Jędrzejewski-Szmek | f6c2e28 | 2012-08-10 19:35:43 +0200 | [diff] [blame] | 102 | |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 103 | <para>Fields in the journal events with a well known meaning.</para> |
Zbigniew Jędrzejewski-Szmek | f6c2e28 | 2012-08-10 19:35:43 +0200 | [diff] [blame] | 104 | |
| 105 | <variablelist id='journal-directives' /> |
| 106 | </refsect1> |
Zbigniew Jędrzejewski-Szmek | 4a431c9 | 2013-01-14 20:18:36 -0500 | [diff] [blame] | 107 | |
| 108 | <refsect1> |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 109 | <title>PAM configuration directives</title> |
| 110 | |
| 111 | <para>Directives for configuring PAM behaviour.</para> |
| 112 | |
| 113 | <variablelist id='pam-directives' /> |
| 114 | </refsect1> |
| 115 | |
| 116 | <refsect1> |
Zbigniew Jędrzejewski-Szmek | 63b03c0 | 2014-06-30 09:27:16 -0400 | [diff] [blame] | 117 | <title><filename>/etc/crypttab</filename> and |
| 118 | <filename>/etc/fstab</filename> options</title> |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 119 | |
| 120 | <para>Options which influence mounted filesystems and |
| 121 | encrypted volumes.</para> |
| 122 | |
Zbigniew Jędrzejewski-Szmek | 63b03c0 | 2014-06-30 09:27:16 -0400 | [diff] [blame] | 123 | <variablelist id='fstab-options' /> |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 124 | </refsect1> |
| 125 | |
| 126 | <refsect1> |
| 127 | <title>System manager directives</title> |
| 128 | |
| 129 | <para>Directives for configuring the behaviour of the |
| 130 | systemd process.</para> |
| 131 | |
| 132 | <variablelist id='systemd-directives' /> |
| 133 | </refsect1> |
| 134 | |
| 135 | <refsect1> |
Lennart Poettering | 81c7dd8 | 2014-11-06 20:06:30 +0100 | [diff] [blame] | 136 | <title>command line options</title> |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 137 | |
| 138 | <para>Command-line options accepted by programs in the |
| 139 | systemd suite.</para> |
| 140 | |
| 141 | <variablelist id='options' /> |
| 142 | </refsect1> |
| 143 | |
| 144 | <refsect1> |
Zbigniew Jędrzejewski-Szmek | 785a51e | 2013-06-26 19:48:19 -0400 | [diff] [blame] | 145 | <title>Constants</title> |
| 146 | |
| 147 | <para>Various constant used and/or defined by systemd.</para> |
| 148 | |
| 149 | <variablelist id='constants' /> |
| 150 | </refsect1> |
| 151 | |
| 152 | <refsect1> |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 153 | <title>Miscellaneous options and directives</title> |
| 154 | |
| 155 | <para>Other configuration elements which don't fit in |
| 156 | any of the above groups.</para> |
| 157 | |
| 158 | <variablelist id='miscellaneous' /> |
| 159 | </refsect1> |
| 160 | |
| 161 | <refsect1> |
Zbigniew Jędrzejewski-Szmek | a4e0b94 | 2013-02-13 21:51:31 -0500 | [diff] [blame] | 162 | <title>Files and directories</title> |
| 163 | |
| 164 | <para>Paths and file names referred to in the |
| 165 | documentation.</para> |
| 166 | |
| 167 | <variablelist id='filenames' /> |
| 168 | </refsect1> |
| 169 | |
| 170 | <refsect1> |
Zbigniew Jędrzejewski-Szmek | 0acfdd6 | 2013-01-14 21:34:19 -0500 | [diff] [blame] | 171 | <title>Colophon</title> |
| 172 | <para id='colophon' /> |
| 173 | </refsect1> |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 174 | </refentry> |
| 175 | ''' |
| 176 | |
Zbigniew Jędrzejewski-Szmek | 0acfdd6 | 2013-01-14 21:34:19 -0500 | [diff] [blame] | 177 | COLOPHON = '''\ |
| 178 | This index contains {count} entries in {sections} sections, |
| 179 | referring to {pages} individual manual pages. |
| 180 | ''' |
| 181 | |
Zbigniew Jędrzejewski-Szmek | d970bd6 | 2013-01-26 11:27:35 -0500 | [diff] [blame] | 182 | def _extract_directives(directive_groups, formatting, page): |
Zbigniew Jędrzejewski-Szmek | 1a13e31 | 2013-03-29 14:22:27 -0400 | [diff] [blame] | 183 | t = xml_parse(page) |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 184 | section = t.find('./refmeta/manvolnum').text |
| 185 | pagename = t.find('./refmeta/refentrytitle').text |
Zbigniew Jędrzejewski-Szmek | a4e0b94 | 2013-02-13 21:51:31 -0500 | [diff] [blame] | 186 | |
| 187 | storopt = directive_groups['options'] |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 188 | for variablelist in t.iterfind('.//variablelist'): |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 189 | klass = variablelist.attrib.get('class') |
| 190 | storvar = directive_groups[klass or 'miscellaneous'] |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 191 | # <option>s go in OPTIONS, unless class is specified |
| 192 | for xpath, stor in (('./varlistentry/term/varname', storvar), |
| 193 | ('./varlistentry/term/option', |
| 194 | storvar if klass else storopt)): |
| 195 | for name in variablelist.iterfind(xpath): |
| 196 | text = re.sub(r'([= ]).*', r'\1', name.text).rstrip() |
| 197 | stor[text].append((pagename, section)) |
Zbigniew Jędrzejewski-Szmek | d970bd6 | 2013-01-26 11:27:35 -0500 | [diff] [blame] | 198 | if text not in formatting: |
| 199 | # use element as formatted display |
Zbigniew Jędrzejewski-Szmek | 699ad6c | 2013-02-27 21:31:02 -0500 | [diff] [blame] | 200 | if name.text[-1] in '= ': |
| 201 | name.clear() |
| 202 | else: |
| 203 | name.tail = '' |
Zbigniew Jędrzejewski-Szmek | d970bd6 | 2013-01-26 11:27:35 -0500 | [diff] [blame] | 204 | name.text = text |
| 205 | formatting[text] = name |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 206 | |
Zbigniew Jędrzejewski-Szmek | a4e0b94 | 2013-02-13 21:51:31 -0500 | [diff] [blame] | 207 | storfile = directive_groups['filenames'] |
Zbigniew Jędrzejewski-Szmek | 845c532 | 2013-05-03 00:55:20 -0400 | [diff] [blame] | 208 | for xpath, absolute_only in (('.//refsynopsisdiv//filename', False), |
| 209 | ('.//refsynopsisdiv//command', False), |
| 210 | ('.//filename', True)): |
Zbigniew Jędrzejewski-Szmek | a4e0b94 | 2013-02-13 21:51:31 -0500 | [diff] [blame] | 211 | for name in t.iterfind(xpath): |
Zbigniew Jędrzejewski-Szmek | 845c532 | 2013-05-03 00:55:20 -0400 | [diff] [blame] | 212 | if absolute_only and not (name.text and name.text.startswith('/')): |
| 213 | continue |
| 214 | if name.attrib.get('noindex'): |
| 215 | continue |
Zbigniew Jędrzejewski-Szmek | a4e0b94 | 2013-02-13 21:51:31 -0500 | [diff] [blame] | 216 | name.tail = '' |
| 217 | if name.text: |
Zbigniew Jędrzejewski-Szmek | 845c532 | 2013-05-03 00:55:20 -0400 | [diff] [blame] | 218 | if name.text.endswith('*'): |
| 219 | name.text = name.text[:-1] |
Zbigniew Jędrzejewski-Szmek | a4e0b94 | 2013-02-13 21:51:31 -0500 | [diff] [blame] | 220 | if not name.text.startswith('.'): |
| 221 | text = name.text.partition(' ')[0] |
| 222 | if text != name.text: |
| 223 | name.clear() |
| 224 | name.text = text |
Zbigniew Jędrzejewski-Szmek | 845c532 | 2013-05-03 00:55:20 -0400 | [diff] [blame] | 225 | if text.endswith('/'): |
| 226 | text = text[:-1] |
Zbigniew Jędrzejewski-Szmek | a4e0b94 | 2013-02-13 21:51:31 -0500 | [diff] [blame] | 227 | storfile[text].append((pagename, section)) |
| 228 | if text not in formatting: |
| 229 | # use element as formatted display |
| 230 | formatting[text] = name |
| 231 | else: |
| 232 | text = ' '.join(name.itertext()) |
| 233 | storfile[text].append((pagename, section)) |
| 234 | formatting[text] = name |
| 235 | |
Zbigniew Jędrzejewski-Szmek | 785a51e | 2013-06-26 19:48:19 -0400 | [diff] [blame] | 236 | storfile = directive_groups['constants'] |
| 237 | for name in t.iterfind('.//constant'): |
| 238 | if name.attrib.get('noindex'): |
| 239 | continue |
| 240 | name.tail = '' |
| 241 | if name.text.startswith('('): # a cast, strip it |
| 242 | name.text = name.text.partition(' ')[2] |
| 243 | storfile[name.text].append((pagename, section)) |
| 244 | formatting[name.text] = name |
| 245 | |
Zbigniew Jędrzejewski-Szmek | d970bd6 | 2013-01-26 11:27:35 -0500 | [diff] [blame] | 246 | def _make_section(template, name, directives, formatting): |
Zbigniew Jędrzejewski-Szmek | eeb019b | 2013-01-14 21:02:49 -0500 | [diff] [blame] | 247 | varlist = template.find(".//*[@id='{}']".format(name)) |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 248 | for varname, manpages in sorted(directives.items()): |
| 249 | entry = tree.SubElement(varlist, 'varlistentry') |
Zbigniew Jędrzejewski-Szmek | d970bd6 | 2013-01-26 11:27:35 -0500 | [diff] [blame] | 250 | term = tree.SubElement(entry, 'term') |
Zbigniew Jędrzejewski-Szmek | 827f70e | 2013-05-29 22:31:20 -0400 | [diff] [blame] | 251 | display = deepcopy(formatting[varname]) |
| 252 | term.append(display) |
Zbigniew Jędrzejewski-Szmek | d970bd6 | 2013-01-26 11:27:35 -0500 | [diff] [blame] | 253 | |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 254 | para = tree.SubElement(tree.SubElement(entry, 'listitem'), 'para') |
| 255 | |
| 256 | b = None |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 257 | for manpage, manvolume in sorted(set(manpages)): |
Zbigniew Jędrzejewski-Szmek | 827f70e | 2013-05-29 22:31:20 -0400 | [diff] [blame] | 258 | if b is not None: |
| 259 | b.tail = ', ' |
| 260 | b = tree.SubElement(para, 'citerefentry') |
| 261 | c = tree.SubElement(b, 'refentrytitle') |
| 262 | c.text = manpage |
Zbigniew Jędrzejewski-Szmek | 958caa5 | 2015-11-22 23:43:36 -0500 | [diff] [blame] | 263 | c.attrib['target'] = varname |
Zbigniew Jędrzejewski-Szmek | 827f70e | 2013-05-29 22:31:20 -0400 | [diff] [blame] | 264 | d = tree.SubElement(b, 'manvolnum') |
| 265 | d.text = manvolume |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 266 | entry.tail = '\n\n' |
| 267 | |
Zbigniew Jędrzejewski-Szmek | 0acfdd6 | 2013-01-14 21:34:19 -0500 | [diff] [blame] | 268 | def _make_colophon(template, groups): |
| 269 | count = 0 |
| 270 | pages = set() |
| 271 | for group in groups: |
| 272 | count += len(group) |
| 273 | for pagelist in group.values(): |
| 274 | pages |= set(pagelist) |
| 275 | |
| 276 | para = template.find(".//para[@id='colophon']") |
| 277 | para.text = COLOPHON.format(count=count, |
| 278 | sections=len(groups), |
| 279 | pages=len(pages)) |
| 280 | |
Zbigniew Jędrzejewski-Szmek | d970bd6 | 2013-01-26 11:27:35 -0500 | [diff] [blame] | 281 | def _make_page(template, directive_groups, formatting): |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 282 | """Create an XML tree from directive_groups. |
| 283 | |
| 284 | directive_groups = { |
| 285 | 'class': {'variable': [('manpage', 'manvolume'), ...], |
| 286 | 'variable2': ...}, |
| 287 | ... |
| 288 | } |
| 289 | """ |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 290 | for name, directives in directive_groups.items(): |
Zbigniew Jędrzejewski-Szmek | 827f70e | 2013-05-29 22:31:20 -0400 | [diff] [blame] | 291 | _make_section(template, name, directives, formatting) |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 292 | |
Zbigniew Jędrzejewski-Szmek | 0acfdd6 | 2013-01-14 21:34:19 -0500 | [diff] [blame] | 293 | _make_colophon(template, directive_groups.values()) |
| 294 | |
Zbigniew Jędrzejewski-Szmek | eeb019b | 2013-01-14 21:02:49 -0500 | [diff] [blame] | 295 | return template |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 296 | |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 297 | def make_page(*xml_files): |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 298 | "Extract directives from xml_files and return XML index tree." |
Zbigniew Jędrzejewski-Szmek | eeb019b | 2013-01-14 21:02:49 -0500 | [diff] [blame] | 299 | template = tree.fromstring(TEMPLATE) |
| 300 | names = [vl.get('id') for vl in template.iterfind('.//variablelist')] |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 301 | directive_groups = {name:collections.defaultdict(list) |
Zbigniew Jędrzejewski-Szmek | eeb019b | 2013-01-14 21:02:49 -0500 | [diff] [blame] | 302 | for name in names} |
Zbigniew Jędrzejewski-Szmek | d970bd6 | 2013-01-26 11:27:35 -0500 | [diff] [blame] | 303 | formatting = {} |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 304 | for page in xml_files: |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 305 | try: |
Zbigniew Jędrzejewski-Szmek | d970bd6 | 2013-01-26 11:27:35 -0500 | [diff] [blame] | 306 | _extract_directives(directive_groups, formatting, page) |
Zbigniew Jędrzejewski-Szmek | ccc9a4f | 2013-01-26 10:47:16 -0500 | [diff] [blame] | 307 | except Exception: |
| 308 | raise ValueError("failed to process " + page) |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 309 | |
Zbigniew Jędrzejewski-Szmek | d970bd6 | 2013-01-26 11:27:35 -0500 | [diff] [blame] | 310 | return _make_page(template, directive_groups, formatting) |
Zbigniew Jędrzejewski-Szmek | d9cfd69 | 2012-08-09 18:08:14 +0200 | [diff] [blame] | 311 | |
| 312 | if __name__ == '__main__': |
Zbigniew Jędrzejewski-Szmek | 1a13e31 | 2013-03-29 14:22:27 -0400 | [diff] [blame] | 313 | with open(sys.argv[1], 'wb') as f: |
| 314 | f.write(xml_print(make_page(*sys.argv[2:]))) |