paul@161 | 1 | #!/usr/bin/env python |
paul@161 | 2 | |
paul@161 | 3 | """ |
paul@161 | 4 | Theming support. |
paul@161 | 5 | |
paul@161 | 6 | Copyright (C) 2018 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.themes.manifest import themes |
paul@161 | 23 | |
paul@161 | 24 | # Top-level functions. |
paul@161 | 25 | |
paul@161 | 26 | def get_theme(name): |
paul@161 | 27 | |
paul@161 | 28 | """ |
paul@161 | 29 | Return the theme class with the given 'name' or None if no such class is |
paul@161 | 30 | found. |
paul@161 | 31 | """ |
paul@161 | 32 | |
paul@161 | 33 | return themes.get(name) |
paul@161 | 34 | |
paul@165 | 35 | def make_theme(metadata, name=None): |
paul@161 | 36 | |
paul@165 | 37 | "Return a theme using the given 'metadata' and optional 'name'." |
paul@161 | 38 | |
paul@165 | 39 | return metadata.get_theme(name) |
paul@161 | 40 | |
paul@161 | 41 | # vim: tabstop=4 expandtab shiftwidth=4 |