本文整理汇总了Python中flickrapi.FlickrAPI.photosets_delete方法的典型用法代码示例。如果您正苦于以下问题:Python FlickrAPI.photosets_delete方法的具体用法?Python FlickrAPI.photosets_delete怎么用?Python FlickrAPI.photosets_delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flickrapi.FlickrAPI
的用法示例。
在下文中一共展示了FlickrAPI.photosets_delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from flickrapi import FlickrAPI [as 别名]
# 或者: from flickrapi.FlickrAPI import photosets_delete [as 别名]
#.........这里部分代码省略.........
log.error("giving up; upload of %s appears to have failed", filepath)
return None
else:
id = rsp.photoid[0].elementText
log.info("file %s uploaded with photoid %s", filepath, id)
return id
def put2Set(self, set_id, photo_id):
log.info("uploading photo %s to set id %s", photo_id, set_id)
rsp = self.fapi.photosets_addPhoto(auth_token=self.authtoken,
photoset_id=set_id, photo_id=photo_id)
if rsp:
log.info("photo uploaded to set")
else:
log.error(rsp.errormsg)
def createSet(self, path, photo_id):
log.info("creating set %s with primary photo %s", path, photo_id)
path, title = os.path.split(path)
rsp = self.fapi.photosets_create(auth_token=self.authtoken,
title=title, primary_photo_id=photo_id)
if rsp:
log.info("created set %s", title)
return rsp.photoset[0]['id']
else:
log.error(rsp.errormsg)
def deleteSet(self, set_id):
log.info("deleting set %s", set_id)
if str(set_id)=="0":
log.info("ignoring attempt to delete set wtih set_id 0 (a locally "
"created set that has not yet acquired an id via uploading")
return
rsp = self.fapi.photosets_delete(auth_token=self.authtoken,
photoset_id=set_id)
if rsp:
log.info("deleted set %s", set_id)
else:
log.error(rsp.errormsg)
def getPhotoInfo(self, photoId):
log.debug("id: %s", photoId)
rsp = self.fapi.photos_getInfo(auth_token=self.authtoken, photo_id=photoId)
if not rsp:
log.error("can't retrieve information about photo %s; got error %s",
photoId, rsp.errormsg)
return None
#XXX: should see if there's some other 'format' option we can fall back to.
try: format = rsp.photo[0]['originalformat']
except KeyError: format = 'jpg'
perm_public = rsp.photo[0].visibility[0]['ispublic']
perm_family = rsp.photo[0].visibility[0]['isfamily']
perm_friend = rsp.photo[0].visibility[0]['isfriend']
if perm_public == '1':
mode = 0755
else:
b_cnt = 4
if perm_family == '1':
b_cnt += 2
if perm_friend == '1':
b_cnt += 1
mode = "07" + str(b_cnt) + "4"
mode = int(mode)
if hasattr(rsp.photo[0],'permissions'):
permcomment = rsp.photo[0].permissions[0]['permcomment']