10 months ago | Paul Boddie | raw files shortlog changelog graph | Improved parameterisation of the get_parser function. | generic-visitors |
moinformat/parsers/__init__.py (file) |
1.1 --- a/moinformat/parsers/__init__.py Fri Jun 30 23:48:16 2023 +0200 1.2 +++ b/moinformat/parsers/__init__.py Sat Jul 01 00:37:44 2023 +0200 1.3 @@ -24,11 +24,11 @@ 1.4 1.5 # Top-level functions. 1.6 1.7 -def get_parser(name="moin"): 1.8 +def get_parser(name=None): 1.9 1.10 "Return the parser class supporting the format with the given 'name'." 1.11 1.12 - return parsers[name] 1.13 + return parsers[name or "moin"] 1.14 1.15 def make_parser(metadata, name=None): 1.16