本文整理匯總了Python中feed.Feed.updated方法的典型用法代碼示例。如果您正苦於以下問題:Python Feed.updated方法的具體用法?Python Feed.updated怎麽用?Python Feed.updated使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類feed.Feed
的用法示例。
在下文中一共展示了Feed.updated方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testEqual
# 需要導入模塊: from feed import Feed [as 別名]
# 或者: from feed.Feed import updated [as 別名]
def testEqual(self):
feed = Feed()
feed.title = self.feed.title
feed.updated = self.feed.updated
feed.entries = self.feed.entries
feed.url = self.feed.url
feed.homepage = self.feed.homepage
feed.author = self.feed.author
self.assertEqual(self.feed, feed)
示例2: createFeedFromData
# 需要導入模塊: from feed import Feed [as 別名]
# 或者: from feed.Feed import updated [as 別名]
def createFeedFromData(data, entryclz=Entry):
if data["bozo"] == 1:
return None
feed = Feed()
if "title" in data["feed"]:
feed.title = data["feed"]["title"]
else:
feed.title = "No Title provided"
if "links" in data["feed"]:
for link in data["feed"]["links"]:
if "rel" in link and link["rel"] == "self":
feed.url = link["href"]
if "link" in data["feed"]:
feed.homepage = data["feed"]["link"]
if "author" in data["feed"]:
feed.author = data["feed"]["author"]
else:
feed.author = "No Author provided"
if "updated_parsed" in data["feed"]:
feed.updated = data["feed"]["updated_parsed"]
for edata in data["entries"]:
feed.entries.append(createEntryFromData(data=edata, entryclz=entryclz))
return feed