MoinLight

Annotated moinformat/links/manifest.py

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