def _load_referrers(self):
referrers_vanilla = []
try:
referrer_file = open(referrer_templates_path)
except Exception as e:
raise FatalException(
core.messages.generic.error_loading_file_s_s %
(referrer_templates_path, str(e)))
for template in referrer_file.read().split('\n'):
if not template.startswith('http'):
continue
referer_format = FirstRefererFormat(self.url)
template_first_formatted = Template(
template).render(tpl=referer_format)
referrers_vanilla.append(
(template_first_formatted, referer_format.chunks_sizes))
return referrers_vanilla
评论列表
文章目录