# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ # # This file is part of elogind. # # Copyright 2012-2013 Zbigniew Jędrzejewski-Szmek # # elogind 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, or # (at your option) any later version. # # elogind 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 elogind; If not, see . import sys import collections import re from xml_helper import * from copy import deepcopy TEMPLATE = '''\ elogind.directives elogind Developer Zbigniew Jędrzejewski-Szmek zbyszek@in.waw.pl elogind.directives 7 elogind.directives Index of configuration directives Environment variables Environment variables understood by the elogind manager and other programs. PAM configuration directives Directives for configuring PAM behaviour. command line options Command-line options accepted by programs in the elogind suite. Constants Various constant used and/or defined by elogind. Miscellaneous options and directives Other configuration elements which don't fit in any of the above groups. Files and directories Paths and file names referred to in the documentation. Colophon ''' COLOPHON = '''\ This index contains {count} entries in {sections} sections, referring to {pages} individual manual pages. ''' def _extract_directives(directive_groups, formatting, page): t = xml_parse(page) section = t.find('./refmeta/manvolnum').text pagename = t.find('./refmeta/refentrytitle').text storopt = directive_groups['options'] for variablelist in t.iterfind('.//variablelist'): klass = variablelist.attrib.get('class') storvar = directive_groups[klass or 'miscellaneous'] #