当前位置: 首页>>代码示例>>Python>>正文


Python Api.delete方法代码示例

本文整理汇总了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 = ''
开发者ID:duffyd,项目名称:kokorice.importer,代码行数:33,代码来源:importblog.py

示例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'])
开发者ID:abhiomkar,项目名称:python-tumblr,代码行数:8,代码来源:tumblr-test.py


注:本文中的tumblr.Api.delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。