本文整理匯總了Python中feed.Feed.get_lang方法的典型用法代碼示例。如果您正苦於以下問題:Python Feed.get_lang方法的具體用法?Python Feed.get_lang怎麽用?Python Feed.get_lang使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類feed.Feed
的用法示例。
在下文中一共展示了Feed.get_lang方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Filter
# 需要導入模塊: from feed import Feed [as 別名]
# 或者: from feed.Feed import get_lang [as 別名]
gettext.textdomain('feedfilter')
feedfile = settings.read_argv()
settings.read_settings()
utils.setupLogger()
# read and parse filterfiles
wordfilter = Filter()
wordfilter.read_filterlist('./blackwordlist.txt')
wordfilter.read_filterlist(settings.sitename)
# Parse feed
feed = Feed(feedfile)
# For now we use the language without any regional variants
lang = feed.get_lang().split('-')[0]
wordlists = {}
for child in feed:
title = feed.get_title(child)
summary = feed.get_description(child)
content = feed.get_content(child)
link = feed.get_link(child)
gid = feed.get_id(child)
# Check for duplicates
maxcmplvl = 0
wordlist = comparetext.analyse(lang, title, summary, content)
for index, dic in wordlists.items():
t = comparetext.comp(wordlist, dic)
maxcmplvl = max(maxcmplvl, t)