mirror of
https://github.com/moparisthebest/xeps
synced 2024-11-21 16:55:07 -05:00
checkdeadlinks: Output the list of dead links on exit.
This commit is contained in:
parent
230bab3bf9
commit
62348c310b
@ -80,18 +80,17 @@ def main():
|
||||
xepfile = 'xep-' + xepnum + '.xml'
|
||||
thexep = parse(xepfile)
|
||||
|
||||
deadlinks = 0
|
||||
if verbose:
|
||||
print 'Checking XEP-' + xepnum + ':'
|
||||
|
||||
urls = [link.getAttribute("url") for link in thexep.getElementsByTagName("link")]
|
||||
urls += [image.getAttribute("src") for image in thexep.getElementsByTagName("img")]
|
||||
|
||||
for url in set(urls):
|
||||
if is_dead(url):
|
||||
deadlinks += 1
|
||||
deadlinks = [url for url in set(urls) if is_dead(url)]
|
||||
|
||||
if deadlinks > 0:
|
||||
if deadlinks:
|
||||
for url in deadlinks:
|
||||
print url
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Loading…
Reference in New Issue
Block a user