mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 08:54:53 +01:00
initial commit of reset method
This commit is contained in:
parent
9eb2d3ff1f
commit
3df0d2023c
1 changed files with 22 additions and 0 deletions
|
|
@ -1,8 +1,30 @@
|
|||
import logging
|
||||
import inspect
|
||||
import avalon.api
|
||||
from openpype.pipeline import BaseCreator
|
||||
|
||||
|
||||
class PublisherController:
|
||||
def __init__(self):
|
||||
self.log = logging.getLogger("PublisherController")
|
||||
self.host = avalon.api.registered_host()
|
||||
|
||||
self.creators = []
|
||||
self.publish_plugins = []
|
||||
self.instances = []
|
||||
|
||||
def reset(self):
|
||||
"""Reset to initial state."""
|
||||
creators = []
|
||||
for creator in avalon.api.discover(BaseCreator):
|
||||
if inspect.isabstract(creator):
|
||||
self.log.info(
|
||||
"Skipping abstract Creator {}".format(str(creator))
|
||||
)
|
||||
continue
|
||||
creators.append(creator)
|
||||
|
||||
self.creators = creators
|
||||
self.publish_plugins = []
|
||||
|
||||
self.instances = self.host.list_instances()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue