本文整理匯總了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