def general_help():
"""Return general help."""
hlp_sntx = RSPET_API.help()
#Read 'state' argument from query string.
cur_state = request.args.get('state')
#Remove excluded functions.
for hlp in EXCLUDED_FUNCTIONS:
if hlp in hlp_sntx:
hlp_sntx.pop(hlp)
#Remove out of scope functions.
tmp = {}
for hlp in hlp_sntx:
if cur_state in hlp_sntx[hlp]['states']:
tmp[hlp] = hlp_sntx[hlp]
return jsonify({'commands': [make_public_help(command, hlp_sntx[command])\
for command in tmp]})
评论列表
文章目录