# HG changeset patch # User Paul Boddie # Date 1513109333 -3600 # Node ID bc22df23b35e03d7498d855c7f25489216d6beae # Parent ac53dccc3c7b0bff7f7f50ed8c097f4890dfe454 Added a parser manifest and exposed manifests via subpackage roots. diff -r ac53dccc3c7b -r bc22df23b35e moinformat/parsers/__init__.py --- a/moinformat/parsers/__init__.py Tue Dec 12 21:02:01 2017 +0100 +++ b/moinformat/parsers/__init__.py Tue Dec 12 21:08:53 2017 +0100 @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +""" +Moin wiki parsers. + +Copyright (C) 2017 Paul Boddie + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 3 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. + +You should have received a copy of the GNU General Public License along with +this program. If not, see . +""" + +from moinformat.parsers.manifest import parsers + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r ac53dccc3c7b -r bc22df23b35e moinformat/parsers/manifest.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/moinformat/parsers/manifest.py Tue Dec 12 21:08:53 2017 +0100 @@ -0,0 +1,44 @@ +#!/usr/bin/env python + +""" +Moin wiki parser manifest. + +Copyright (C) 2017 Paul Boddie + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 3 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. + +You should have received a copy of the GNU General Public License along with +this program. If not, see . +""" + +from moinformat.imports import get_extensions +from os.path import split + +reserved = ["__init__", "common", "manifest"] + +# Obtain details of this module's package. + +dirname = split(__file__)[0] +package = __name__.rsplit(".", 1)[0] + +# Define an attribute mapping names to modules. + +modules = {} +get_extensions(dirname, package, modules, reserved) + +# Obtain all parsers. + +parsers = {} + +for module_name, module in modules.items(): + parsers[module_name] = module.parser + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r ac53dccc3c7b -r bc22df23b35e moinformat/parsers/table.py --- a/moinformat/parsers/table.py Tue Dec 12 21:02:01 2017 +0100 +++ b/moinformat/parsers/table.py Tue Dec 12 21:08:53 2017 +0100 @@ -118,4 +118,6 @@ "regionend" : parse_table_end, }) +parser = TableParser + # vim: tabstop=4 expandtab shiftwidth=4 diff -r ac53dccc3c7b -r bc22df23b35e moinformat/serialisers/__init__.py --- a/moinformat/serialisers/__init__.py Tue Dec 12 21:02:01 2017 +0100 +++ b/moinformat/serialisers/__init__.py Tue Dec 12 21:08:53 2017 +0100 @@ -19,6 +19,7 @@ this program. If not, see . """ +from moinformat.serialisers.manifest import serialisers from moinformat.serialisers.moin import MoinSerialiser # Top-level functions.