本文整理汇总了Python中models.Feed.finish_report方法的典型用法代码示例。如果您正苦于以下问题:Python Feed.finish_report方法的具体用法?Python Feed.finish_report怎么用?Python Feed.finish_report使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Feed
的用法示例。
在下文中一共展示了Feed.finish_report方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open
# 需要导入模块: from models import Feed [as 别名]
# 或者: from models.Feed import finish_report [as 别名]
with open(join(PATH, 'urls', urls_filename)) as urls:
urls = urls.read().splitlines()
ignored = lambda url: not url.strip().startswith('#')
urls = filter(ignored, urls)
urls = filter(None, urls)
# Path to scraped feed data for this state.
STATE_FEED_DATA = join('data', 'feeds')
try:
shutil.rmtree(STATE_FEED_DATA)
except OSError:
pass
try:
os.makedirs(STATE_FEED_DATA)
except OSError:
pass
extractor = Extractor(abbr)
for url in urls:
feed = Feed(url)
for entry in feed.entries():
extractor.process_entry(entry.entry)
import ipdb;ipdb.set_trace()
entry.finish_report(abbr)
entry.save_if_entities_found()
feed.finish_report()
feed.save()