mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Removed usage of http_server
This commit is contained in:
parent
690bb9f8b1
commit
f8743e3b80
1 changed files with 31 additions and 0 deletions
|
|
@ -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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue