本文整理汇总了Python中feed.Feed.url方法的典型用法代码示例。如果您正苦于以下问题:Python Feed.url方法的具体用法?Python Feed.url怎么用?Python Feed.url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feed.Feed
的用法示例。
在下文中一共展示了Feed.url方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testEqual
# 需要导入模块: from feed import Feed [as 别名]
# 或者: from feed.Feed import url [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: htmlSource
# 需要导入模块: from feed import Feed [as 别名]
# 或者: from feed.Feed import url [as 别名]
def htmlSource(request):
sites = ['FourChan', 'Fukung', 'Senorgif', 'Knowyourmeme' ]
random.shuffle(sites)
images = []
images = globals()[sites[0]]().do().images()
while not images:
random.shuffle(sites)
images = globals()[sites[0]]().do().images()
random.shuffle(images)
if not Feed.gql("WHERE url = :1", images[0]).fetch(1):
feed = Feed()
feed.url = images[0]
feed.put()
return render_to_response('boardTemplate.html', {'image' : images[0]})
示例3: createFeedFromData
# 需要导入模块: from feed import Feed [as 别名]
# 或者: from feed.Feed import url [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