diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-05-11 22:03:09 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-05-11 22:03:09 -0400 |
commit | f61b08939e2ce45cb2563ebb4cf3210e5e8343f3 (patch) | |
tree | a9f426ad3cba9804ae193d28de76a5fdf1a540d2 /tools/xml_helper.py | |
parent | f375f601941dde66d8357fb22f560cea80d97fd4 (diff) |
man pages
Diffstat (limited to 'tools/xml_helper.py')
-rw-r--r-- | tools/xml_helper.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/xml_helper.py b/tools/xml_helper.py index e87126f2f7..07353847ba 100644 --- a/tools/xml_helper.py +++ b/tools/xml_helper.py @@ -18,11 +18,17 @@ # along with systemd; If not, see <http://www.gnu.org/licenses/>. from lxml import etree as tree +import os.path class CustomResolver(tree.Resolver): def resolve(self, url, id, context): - if 'custom-entities.ent' in url: - return self.resolve_filename('man/custom-entities.ent', context) + if not os.path.exists(url): + srcdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + basename = os.path.basename(url) + if basename == 'custom-entities.ent': + basename = 'custom-entities.ent.in' + url = os.path.join(srcdir, 'man', basename) + return self.resolve_filename(url, context) _parser = tree.XMLParser() _parser.resolvers.add(CustomResolver()) |