本文整理汇总了Python中feed.Feed.author方法的典型用法代码示例。如果您正苦于以下问题:Python Feed.author方法的具体用法?Python Feed.author怎么用?Python Feed.author使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feed.Feed
的用法示例。
在下文中一共展示了Feed.author方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testEqual
# 需要导入模块: from feed import Feed [as 别名]
# 或者: from feed.Feed import author [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 author [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