1.1 --- a/moinformat/output/__init__.py Mon Jul 30 01:03:50 2018 +0200
1.2 +++ b/moinformat/output/__init__.py Mon Jul 30 17:18:52 2018 +0200
1.3 @@ -19,12 +19,30 @@
1.4 this program. If not, see <http://www.gnu.org/licenses/>.
1.5 """
1.6
1.7 -from moinformat.output.directory import DirectoryOutput
1.8 +from moinformat.output.manifest import outputs
1.9 +
1.10 +# Top-level functions.
1.11 +
1.12 +def get_output(name):
1.13
1.14 -def make_output(dirname):
1.15 + """
1.16 + Return the output context class with the given 'name' or None if no such
1.17 + class is found.
1.18 + """
1.19 +
1.20 + return outputs.get(name)
1.21
1.22 - "Return a directory output context employing 'dirname'."
1.23 +def make_output(name, parameters=None):
1.24
1.25 - return DirectoryOutput(dirname)
1.26 + """
1.27 + Return an output context of the type indicated by 'name', employing the
1.28 + given 'parameters'.
1.29 + """
1.30 +
1.31 + output_cls = get_output(name)
1.32 + if not output_cls:
1.33 + return None
1.34 +
1.35 + return output_cls(parameters)
1.36
1.37 # vim: tabstop=4 expandtab shiftwidth=4