本文整理汇总了Python中API.execute_method方法的典型用法代码示例。如果您正苦于以下问题:Python API.execute_method方法的具体用法?Python API.execute_method怎么用?Python API.execute_method使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类API
的用法示例。
在下文中一共展示了API.execute_method方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_auth_url
# 需要导入模块: import API [as 别名]
# 或者: from API import execute_method [as 别名]
def get_auth_url(self, frob, perms):
""" Given a frob obtained via a 'flickr.auth.getFrob' and perms
(currently read, write, or delete) return a url for desktop client api
authentication
Deprecated in 0.4.1, use get_authurl for new applications """
return get_authurl(perms, frob=frob)
def _sign_args(self, args):
return sign_args(self.secret, args)
class Request(urllib2.Request):
""" A request to the Flickr API subclassed from urllib2.Request allowing for custom proxy, cache, headers, etc """
def __init__(self, apiurl='http://api.flickr.com/services/rest/', **args):
urllib2.Request.__init__(self, url=apiurl)
self.args = args
if (__name__ == '__main__'):
import sys
try:
key = sys.argv[1]
secret = sys.argv[2]
except IndexError:
print "Usage: %s <key> <secret>" % (sys.argv[0],)
sys.exit(1)
api = API(key, secret)
res = api.execute_method(method='flickr.test.echo', args={'foo':'bar'})