本文整理汇总了Python中API.API.get_hooks方法的典型用法代码示例。如果您正苦于以下问题:Python API.get_hooks方法的具体用法?Python API.get_hooks怎么用?Python API.get_hooks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类API.API
的用法示例。
在下文中一共展示了API.get_hooks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: admin
# 需要导入模块: from API import API [as 别名]
# 或者: from API.API import get_hooks [as 别名]
def admin(self):
# Check if the user is an admin
if cherrypy.session.get("usertype", "user") == "admin":
tmpl = lookup.get_template("admin.html.mako")
if settings['web_use_auth'] == "true":
return tmpl.render(
username = cherrypy.session['username'],
userimageurl = cherrypy.session['userimageurl'],
usertype = cherrypy.session['usertype'],
settings = settings,
users = API.get_users(),
hooks = API.get_hooks()
)
else:
return tmpl.render(
username = cherrypy.session.get("username", "dev"),
userimageurl = cherrypy.session.get("userimageurl", "dev"),
usertype = cherrypy.session.get("usertype", "admin"),
settings = settings,
users = API.get_users(),
hooks = API.get_hooks()
)
else:
return json.dumps({"error": "User not authorized for this request"})
示例2: get_hooks
# 需要导入模块: from API import API [as 别名]
# 或者: from API.API import get_hooks [as 别名]
def get_hooks(self, id=None, action=None, target=None, state=None, api_token=None):
return API.get_hooks(id, action, target, state, api_token)