Private GIT

Skip to content
Snippets Groups Projects
Commit f87701e9 authored by Nic Wolfe's avatar Nic Wolfe
Browse files

Merge pull request #258 from lad1337/api_image_chaining

handle getbanner and getposter while chaining.
parents 61b8229b 1c72aef8
Branches
Tags
No related merge requests found
...@@ -221,6 +221,7 @@ def call_dispatcher(args, kwargs): ...@@ -221,6 +221,7 @@ def call_dispatcher(args, kwargs):
cmd, cmdIndex = cmd.split("_") # this gives us the clear cmd and the index cmd, cmdIndex = cmd.split("_") # this gives us the clear cmd and the index
logger.log(u"API :: " + cmd + ": curKwargs " + str(curKwargs), logger.DEBUG) logger.log(u"API :: " + cmd + ": curKwargs " + str(curKwargs), logger.DEBUG)
if not (multiCmds and cmd in ('show.getposter','show.getbanner')): # skip these cmd while chaining
try: try:
if cmd in _functionMaper: if cmd in _functionMaper:
curOutDict = _functionMaper.get(cmd)(curArgs, curKwargs).run() # get the cmd class, init it and run() curOutDict = _functionMaper.get(cmd)(curArgs, curKwargs).run() # get the cmd class, init it and run()
...@@ -230,6 +231,8 @@ def call_dispatcher(args, kwargs): ...@@ -230,6 +231,8 @@ def call_dispatcher(args, kwargs):
curOutDict = _responds(RESULT_ERROR, "No such cmd: '" + cmd + "'") curOutDict = _responds(RESULT_ERROR, "No such cmd: '" + cmd + "'")
except ApiError, e: # Api errors that we raised, they are harmless except ApiError, e: # Api errors that we raised, they are harmless
curOutDict = _responds(RESULT_ERROR, msg=ex(e)) curOutDict = _responds(RESULT_ERROR, msg=ex(e))
else: # if someone chained one of the forbiden cmds they will get an error for this one cmd
curOutDict = _responds(RESULT_ERROR, msg="The cmd '"+cmd+"' is not supported while chaining")
if multiCmds: if multiCmds:
# note: if multiple same cmds are issued but one has not an index defined it will override all others # note: if multiple same cmds are issued but one has not an index defined it will override all others
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment