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