def get_index(self):
'''Get index page of periodic job and returns all links to jobs'''
url = urljoin(self.config.log_url, self.args.job)
res = get_html(url)
if res is None or not res.ok:
return []
body = res.content.decode() if res.content else ''
hrefs = [HREF.search(l).group(1)
for l in body.splitlines() if HREF.search(l)]
links = ["/".join((url, link))
for link in hrefs if JOBRE.match(link)]
if links:
# Number of links to return
return links[:NLINKS]
else:
return []
评论列表
文章目录