def _update_cache(release):
LOG.debug('Updating cache for the release "%s"', release)
url = BASE_URL % release
html_page = urllib.request.urlopen(url)
soup = BeautifulSoup(html_page)
specs = {}
for link in soup.findAll('a', attrs={'href': re.compile('.html$')}):
href = link.get('href')
title = ' '.join(href.replace('.html', '').split('-'))
link = url + href
specs[title] = link
_CACHE[release] = {}
_CACHE[release]['specs'] = specs
_CACHE[release]['updated_at'] = datetime.datetime.utcnow()
LOG.info('Cache updated for the release "%s"', release)
评论列表
文章目录