本文整理汇总了Python中tumblr.Api.delete方法的典型用法代码示例。如果您正苦于以下问题:Python Api.delete方法的具体用法?Python Api.delete怎么用?Python Api.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tumblr.Api
的用法示例。
在下文中一共展示了Api.delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Api
# 需要导入模块: from tumblr import Api [as 别名]
# 或者: from tumblr.Api import delete [as 别名]
image = gd_client.InsertPhotoSimple(album_url, title, title,
filename, content_type='image/jpeg')
except GooglePhotosException:
print "There was an error processing: %s" % filename
unprocessedimgs.append((title, filename))
return image
if __name__ == '__main__':
processedimg = False
api = Api(BLOG, USER, PASSWORD)
posts = api.read()
for post in posts:
# Delete the existing posts
posturl = post['url-with-slug']
api.delete(post['id'])
print "Deleted %s" % posturl
blogfeed = feedparser.parse(open('@@rss.xml', 'rb').read())
gd_client = logon_to_picasaweb()
albumfound = [album for album in gd_client.GetUserFeed(user=USER).entry if album.title.text == 'Blog Images']
if not len(albumfound) > 0:
# Doesn't exist so create
# a new photo album
album = gd_client.InsertAlbum(title='Blog Images', summary='Images for kokorice.org')
print "Created %s" % album.title.text
else:
album = albumfound[0]
print "%s album already exists" % album.title.text
if blogfeed:
for entryidx, entry in enumerate(blogfeed.entries):
entrysummary = ''
示例2: testDelete
# 需要导入模块: from tumblr import Api [as 别名]
# 或者: from tumblr.Api import delete [as 别名]
def testDelete(self):
api = Api(BLOG, USER, PASSWORD)
newpost = api.write_regular('title','body')
post = api.read(newpost['id'])
api.delete(post['id'])