mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-16 22:10:26 +00:00
Run black on doc/
This commit is contained in:
parent
182e394139
commit
fbf3a8ab20
2 changed files with 11 additions and 8 deletions
|
|
@ -28,21 +28,24 @@ def main(args):
|
|||
with open(filename) as fd:
|
||||
tree = parse(fd)
|
||||
filter_tree(tree)
|
||||
tree.write(sys.stdout, encoding='utf-8')
|
||||
tree.write(sys.stdout, encoding="utf-8")
|
||||
|
||||
|
||||
def filter_tree(tree):
|
||||
"""Filter all 401 errors."""
|
||||
to_remove = []
|
||||
for elem in tree.findall('urldata'):
|
||||
valid = elem.find('valid')
|
||||
if valid is not None and valid.text == '0' and \
|
||||
valid.attrib.get('result', '').startswith('401'):
|
||||
for elem in tree.findall("urldata"):
|
||||
valid = elem.find("valid")
|
||||
if (
|
||||
valid is not None
|
||||
and valid.text == "0"
|
||||
and valid.attrib.get("result", "").startswith("401")
|
||||
):
|
||||
to_remove.append(elem)
|
||||
root = tree.getroot()
|
||||
for elem in to_remove:
|
||||
root.remove(elem)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv[1:])
|
||||
|
|
|
|||
|
|
@ -34,6 +34,6 @@ def chmod(config):
|
|||
|
||||
|
||||
hooks = {
|
||||
'site.output.post': [compress_javascript, compress_css],
|
||||
'site.done': [chmod],
|
||||
"site.output.post": [compress_javascript, compress_css],
|
||||
"site.done": [chmod],
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue