mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
tools: pylint xml_helper.py
This commit is contained in:
parent
234909f9d6
commit
54a9070ce5
@ -3,14 +3,18 @@
|
|||||||
|
|
||||||
from lxml import etree as tree
|
from lxml import etree as tree
|
||||||
|
|
||||||
|
|
||||||
class CustomResolver(tree.Resolver):
|
class CustomResolver(tree.Resolver):
|
||||||
def resolve(self, url, id, context):
|
def resolve(self, url, _id, context):
|
||||||
if 'custom-entities.ent' in url:
|
if 'custom-entities.ent' in url:
|
||||||
return self.resolve_filename('man/custom-entities.ent', context)
|
return self.resolve_filename('man/custom-entities.ent', context)
|
||||||
if 'ethtool-link-mode' in url:
|
if 'ethtool-link-mode' in url:
|
||||||
return self.resolve_filename('src/shared/ethtool-link-mode.xml', context)
|
return self.resolve_filename('src/shared/ethtool-link-mode.xml', context)
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
_parser = tree.XMLParser()
|
_parser = tree.XMLParser()
|
||||||
|
# pylint: disable=no-member
|
||||||
_parser.resolvers.add(CustomResolver())
|
_parser.resolvers.add(CustomResolver())
|
||||||
|
|
||||||
def xml_parse(page):
|
def xml_parse(page):
|
||||||
|
Loading…
Reference in New Issue
Block a user