paul@161 | 1 | #!/usr/bin/env python |
paul@161 | 2 | |
paul@161 | 3 | """ |
paul@161 | 4 | Theme implementation manifest. |
paul@161 | 5 | |
paul@301 | 6 | Copyright (C) 2017, 2018, 2021 Paul Boddie <paul@boddie.org.uk> |
paul@161 | 7 | |
paul@161 | 8 | This program is free software; you can redistribute it and/or modify it under |
paul@161 | 9 | the terms of the GNU General Public License as published by the Free Software |
paul@161 | 10 | Foundation; either version 3 of the License, or (at your option) any later |
paul@161 | 11 | version. |
paul@161 | 12 | |
paul@161 | 13 | This program is distributed in the hope that it will be useful, but WITHOUT |
paul@161 | 14 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
paul@161 | 15 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
paul@161 | 16 | details. |
paul@161 | 17 | |
paul@161 | 18 | You should have received a copy of the GNU General Public License along with |
paul@161 | 19 | this program. If not, see <http://www.gnu.org/licenses/>. |
paul@161 | 20 | """ |
paul@161 | 21 | |
paul@161 | 22 | from moinformat.imports import get_extensions, get_mapping, get_modules |
paul@161 | 23 | |
paul@177 | 24 | ignore = ["html"] |
paul@177 | 25 | |
paul@161 | 26 | # Define an attribute mapping names to modules. |
paul@161 | 27 | |
paul@161 | 28 | modules = get_modules(__file__, __name__) |
paul@161 | 29 | |
paul@177 | 30 | # Filter out modules in this package that provide common functionality. |
paul@177 | 31 | |
paul@177 | 32 | for m in ignore: |
paul@177 | 33 | if modules.has_key(m): |
paul@177 | 34 | del modules[m] |
paul@177 | 35 | |
paul@161 | 36 | # Obtain all themes. |
paul@161 | 37 | |
paul@161 | 38 | # Use module paths to register the contexts: |
paul@161 | 39 | # theme_name.output_format -> theme |
paul@161 | 40 | |
paul@301 | 41 | themes = get_mapping(modules, lambda n, m: [n], lambda m: m.theme) |
paul@161 | 42 | |
paul@161 | 43 | # vim: tabstop=4 expandtab shiftwidth=4 |