Removed usage of http_server

This commit is contained in:
Petr Kalis 2020-08-21 15:23:35 +02:00
parent 690bb9f8b1
commit f8743e3b80

View file

@ -1,5 +1,8 @@
from pype.api import Logger
from wsrpc_aiohttp import WebSocketRoute
import functools
import avalon.photoshop as photoshop
log = Logger().get_logger("WebsocketServer")
@ -31,3 +34,31 @@ class Photoshop(WebSocketRoute):
log.debug("photoshop.read client calls server server calls "
"Photo client")
return await self.socket.call('Photoshop.read')
# panel routes for tools
async def creator_route(self):
self._tool_route("creator")
async def workfiles_route(self):
self._tool_route("workfiles")
async def loader_route(self):
self._tool_route("loader")
async def publish_route(self):
self._tool_route("publish")
async def sceneinventory_route(self):
self._tool_route("sceneinventory")
async def projectmanager_route(self):
self._tool_route("projectmanager")
def _tool_route(self, tool_name):
"""The address accessed when clicking on the buttons."""
partial_method = functools.partial(photoshop.show, tool_name)
photoshop.execute_in_main_thread(partial_method)
# Required return statement.
return "nothing"