本文整理汇总了Python中smugpy.SmugMug.auth_checkAccessToken方法的典型用法代码示例。如果您正苦于以下问题:Python SmugMug.auth_checkAccessToken方法的具体用法?Python SmugMug.auth_checkAccessToken怎么用?Python SmugMug.auth_checkAccessToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类smugpy.SmugMug
的用法示例。
在下文中一共展示了SmugMug.auth_checkAccessToken方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SmugMug
# 需要导入模块: from smugpy import SmugMug [as 别名]
# 或者: from smugpy.SmugMug import auth_checkAccessToken [as 别名]
# parse config file
config = configparser.ConfigParser()
config.read(SCRIPTPATH+'/smugmuglinkgen.conf')
API_KEY = config.get('main', 'api_key')
API_SECRET = config.get('main', 'api_secret')
TOKEN = config.get('main', 'token')
SECRET = config.get('main', 'secret')
USERNAME = config.get('main', 'smugmug_user')
# set up smugmug API
smugmug = SmugMug(api_key=API_KEY, oauth_secret=API_SECRET, app_name="get_gallery_links")
# oauth
if TOKEN and SECRET:
smugmug.set_oauth_token(TOKEN, SECRET)
response = smugmug.auth_checkAccessToken()
#print response
else:
smugmug.auth_getRequestToken()
raw_input("Authorize app at %s\n\nPress Enter when complete.\n" % (smugmug.authorize(access='Full')))
response = smugmug.auth_getAccessToken()
print(" token: %s" % response['Auth']['Token']['id'])
print(" secret: %s" % response['Auth']['Token']['Secret'])
print("Enter these values into smugmuglinkgen.conf to skip this auth process the next time around.")
# the real work starts here
albums = smugmug.albums_get(NickName=USERNAME)
for album in albums['Albums']:
if arguments['list']:
print(album['Title'])
else: