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