summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2017-05-12 17:51:55 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2017-05-12 17:51:55 +0200
commit762fa897d2abe72412f9d16948ac2f172ce8b721 (patch)
tree18e55b82e45af6695b4527ddd9a41d4d9f9abd3c
parente80a005de6de339e1abad140c0ed2cfa0ef7dbaf (diff)
downloadpsutil-762fa897d2abe72412f9d16948ac2f172ce8b721.tar.gz
parse comment blocks
-rwxr-xr-xscripts/internal/check_broken_links.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/internal/check_broken_links.py b/scripts/internal/check_broken_links.py
index 2d2d9d30..70f368e0 100755
--- a/scripts/internal/check_broken_links.py
+++ b/scripts/internal/check_broken_links.py
@@ -109,10 +109,16 @@ def get_urls_py(filename):
if urls:
assert len(urls) == 1, urls
url = urls[0]
- if line.startswith('# '):
- nextline = lines[i + 1].strip()
- if re.match('^# .+', nextline):
- url += nextline[1:].strip()
+ # comment block
+ if line.lstrip().startswith('# '):
+ subidx = i + 1
+ while 1:
+ nextline = lines[subidx].strip()
+ if re.match('^# .+', nextline):
+ url += nextline[1:].strip()
+ else:
+ break
+ subidx += 1
ret.add(url)
return list(ret)