MoinLight

Annotated moinformat/serialisers/manifest.py

176:47af441b48bf
2018-11-26 Paul Boddie Support linking to stylesheets based on the collection of available files.
paul@39 1
#!/usr/bin/env python
paul@39 2
paul@39 3
"""
paul@39 4
Moin wiki serialiser manifest.
paul@39 5
paul@109 6
Copyright (C) 2017, 2018 Paul Boddie <paul@boddie.org.uk>
paul@39 7
paul@39 8
This program is free software; you can redistribute it and/or modify it under
paul@39 9
the terms of the GNU General Public License as published by the Free Software
paul@39 10
Foundation; either version 3 of the License, or (at your option) any later
paul@39 11
version.
paul@39 12
paul@39 13
This program is distributed in the hope that it will be useful, but WITHOUT
paul@39 14
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
paul@39 15
FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
paul@39 16
details.
paul@39 17
paul@39 18
You should have received a copy of the GNU General Public License along with
paul@39 19
this program.  If not, see <http://www.gnu.org/licenses/>.
paul@39 20
"""
paul@39 21
paul@109 22
from moinformat.imports import get_extensions, get_mapping, get_modules
paul@39 23
paul@39 24
# Define an attribute mapping names to modules.
paul@39 25
paul@109 26
modules = get_modules(__file__, __name__)
paul@39 27
paul@39 28
# Obtain all serialisers.
paul@39 29
paul@160 30
# Use module paths to register the handlers:
paul@160 31
# output_format.input_format -> serialiser
paul@39 32
paul@109 33
serialisers = get_mapping(modules, lambda n, m: n, lambda m: m.serialiser)
paul@39 34
paul@39 35
# vim: tabstop=4 expandtab shiftwidth=4