AMI Custom Protocol Handlers and the registry

yes and no,
inside my plugins I do have a
if name == “main”:

so that if the plugin is run outside of a package as the main execute from the command-line, or other outside interpreter initiated from a direct call to “python” then it will do something, in my case it prompts the user in the terminal to input an ID… but that is not something you need to implement if you don’t need it.

both would need to be called with some sort of input from the user as arguments… the ami_handler would look for a valid URL… that it can parse… and the way I setup my plugins they would look for IDs that would need to exist inside the shotgun database…

Hope that helps…
I did all my debugging using the logs from the ami_handler, when testing full functionality, but yes i tested all my plugins before hand using direct calls and supplying dummy IDs that existed in my testing project within shotgun.

PS: you would need to call the shotgun_ami_handler as you would a normal python class…

import shotgun_ami_handler as SAH
SAH.ShotgunAction(VALID_URL)

also remember that class is not setup to return anything… it writes to a log file, so if u were to test like that, maybe you would want to write a handler to return some information that you were debugging? So you see some instant response in the terminal
-Ross

2 Likes