1.1 --- a/moinformat/__init__.py Tue Jul 24 18:45:13 2018 +0200
1.2 +++ b/moinformat/__init__.py Tue Jul 24 18:45:32 2018 +0200
1.3 @@ -22,9 +22,21 @@
1.4 from moinformat.parsers import parse, parsers as all_parsers
1.5 from moinformat.serialisers import serialise, serialisers as all_serialisers
1.6
1.7 +def get_parser(name="moin"):
1.8 +
1.9 + "Return the parser class supporting the format with the given 'name'."
1.10 +
1.11 + return all_parsers[name]
1.12 +
1.13 +def make_parser(name="moin"):
1.14 +
1.15 + "Return a parser instance for the format with the given 'name'."
1.16 +
1.17 + return get_parser(name)(all_parsers)
1.18 +
1.19 def get_serialiser(name):
1.20
1.21 - "Return the main serialiser for the format having the given 'name'."
1.22 + "Return the main serialiser class for the format having the given 'name'."
1.23
1.24 return all_serialisers["%s.moin" % name]
1.25