def _handle_command(self, uid):
"""
Handles an RPC engine command execution request.
:param int uid: The unique id of the engine command to run.
"""
self.logger.debug("Handling command request for uid: %s" % (uid,))
with self.heartbeat_disabled():
from sgtk.platform.qt import QtGui
if uid == self.__jump_to_fs_command_id:
# jump to fs special command triggered
self._jump_to_fs()
elif uid == self.__jump_to_sg_command_id:
# jump to sg special command triggered
self._jump_to_sg()
else:
# a registered command was triggered
for command in self.commands.values():
if command.get("properties", dict()).get("uid") == uid:
self.logger.debug(
"Executing callback for command: %s" % (command,))
result = command["callback"]()
if isinstance(result, QtGui.QWidget):
# if the callback returns a widget, keep a handle on it
self.__qt_dialogs.append(result)
评论列表
文章目录