mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
use lib functions from webpublisher
This commit is contained in:
parent
c1a7b9aff5
commit
6c330c4896
7 changed files with 34 additions and 36 deletions
|
|
@ -17,11 +17,11 @@ import os
|
|||
|
||||
import pyblish.api
|
||||
|
||||
from openpype.lib.plugin_tools import (
|
||||
parse_json,
|
||||
get_batch_asset_task_info
|
||||
)
|
||||
from openpype.pipeline import legacy_io
|
||||
from openpype_modules.webpublisher.lib import (
|
||||
get_batch_asset_task_info,
|
||||
parse_json
|
||||
)
|
||||
|
||||
|
||||
class CollectBatchData(pyblish.api.ContextPlugin):
|
||||
|
|
|
|||
|
|
@ -4,7 +4,15 @@ import pyblish.api
|
|||
import pyblish.util
|
||||
|
||||
from openpype.lib import Logger
|
||||
from openpype.lib.remote_publish import (
|
||||
from openpype.lib.applications import (
|
||||
ApplicationManager,
|
||||
get_app_environments_for_context,
|
||||
)
|
||||
from openpype.pipeline import install_host
|
||||
from openpype.hosts.webpublisher.api import WebpublisherHost
|
||||
|
||||
from .lib import (
|
||||
get_batch_asset_task_info,
|
||||
get_webpublish_conn,
|
||||
start_webpublish_log,
|
||||
publish_and_log,
|
||||
|
|
@ -14,13 +22,6 @@ from openpype.lib.remote_publish import (
|
|||
get_timeout,
|
||||
IN_PROGRESS_STATUS
|
||||
)
|
||||
from openpype.lib.applications import (
|
||||
ApplicationManager,
|
||||
get_app_environments_for_context,
|
||||
)
|
||||
from openpype.lib.plugin_tools import get_batch_asset_task_info
|
||||
from openpype.pipeline import install_host
|
||||
from openpype.hosts.webpublisher.api import WebpublisherHost
|
||||
|
||||
|
||||
def cli_publish(project_name, batch_path, user_email, targets):
|
||||
|
|
|
|||
|
|
@ -13,12 +13,13 @@ import os
|
|||
|
||||
import pyblish.api
|
||||
|
||||
from openpype.lib.plugin_tools import (
|
||||
parse_json,
|
||||
get_batch_asset_task_info
|
||||
)
|
||||
from openpype.lib.remote_publish import get_webpublish_conn, IN_PROGRESS_STATUS
|
||||
from openpype.pipeline import legacy_io
|
||||
from openpype_modules.webpublisher.lib import (
|
||||
parse_json,
|
||||
get_batch_asset_task_info,
|
||||
get_webpublish_conn,
|
||||
IN_PROGRESS_STATUS
|
||||
)
|
||||
|
||||
|
||||
class CollectBatchData(pyblish.api.ContextPlugin):
|
||||
|
|
|
|||
|
|
@ -23,10 +23,8 @@ from openpype.lib import (
|
|||
get_ffprobe_streams,
|
||||
convert_ffprobe_fps_value,
|
||||
)
|
||||
from openpype.lib.plugin_tools import (
|
||||
parse_json,
|
||||
get_subset_name_with_asset_doc
|
||||
)
|
||||
from openpype.lib.plugin_tools import get_subset_name_with_asset_doc
|
||||
from openpype_modules.webpublisher.lib import parse_json
|
||||
|
||||
|
||||
class CollectPublishedFiles(pyblish.api.ContextPlugin):
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ import uuid
|
|||
import json
|
||||
import shutil
|
||||
import pyblish.api
|
||||
from openpype.lib.plugin_tools import parse_json
|
||||
from openpype.hosts.tvpaint.worker import (
|
||||
SenderTVPaintCommands,
|
||||
CollectSceneData
|
||||
)
|
||||
from openpype_modules.webpublisher.lib import parse_json
|
||||
|
||||
|
||||
class CollectTVPaintWorkfileData(pyblish.api.ContextPlugin):
|
||||
|
|
|
|||
|
|
@ -10,16 +10,16 @@ from aiohttp.web_response import Response
|
|||
from openpype.client import (
|
||||
get_projects,
|
||||
get_assets,
|
||||
OpenPypeMongoConnection,
|
||||
)
|
||||
from openpype.lib import Logger
|
||||
from openpype.lib.remote_publish import (
|
||||
from openpype.settings import get_project_settings
|
||||
from openpype_modules.webserver.base_routes import RestApiEndpoint
|
||||
from openpype_modules.webpublisher.lib import (
|
||||
get_webpublish_conn,
|
||||
get_task_data,
|
||||
ERROR_STATUS,
|
||||
REPROCESS_STATUS
|
||||
)
|
||||
from openpype.settings import get_project_settings
|
||||
from openpype_modules.webserver.base_routes import RestApiEndpoint
|
||||
|
||||
log = Logger.get_logger("WebpublishRoutes")
|
||||
|
||||
|
|
@ -77,9 +77,7 @@ class WebpublishRestApiResource(JsonApiResource):
|
|||
"""Resource carrying OP DB connection for storing batch info into DB."""
|
||||
|
||||
def __init__(self):
|
||||
mongo_client = OpenPypeMongoConnection.get_mongo_client()
|
||||
database_name = os.environ["OPENPYPE_DATABASE_NAME"]
|
||||
self.dbcon = mongo_client[database_name]["webpublishes"]
|
||||
self.dbcon = get_webpublish_conn()
|
||||
|
||||
|
||||
class ProjectsEndpoint(ResourceRestApiEndpoint):
|
||||
|
|
|
|||
|
|
@ -7,8 +7,15 @@ import json
|
|||
import subprocess
|
||||
|
||||
from openpype.client import OpenPypeMongoConnection
|
||||
from openpype.modules import ModulesManager
|
||||
from openpype.lib import Logger
|
||||
|
||||
from openpype_modules.webpublisher.lib import (
|
||||
ERROR_STATUS,
|
||||
REPROCESS_STATUS,
|
||||
SENT_REPROCESSING_STATUS
|
||||
)
|
||||
|
||||
from .webpublish_routes import (
|
||||
RestApiResource,
|
||||
WebpublishRestApiResource,
|
||||
|
|
@ -21,19 +28,12 @@ from .webpublish_routes import (
|
|||
TaskPublishEndpoint,
|
||||
UserReportEndpoint
|
||||
)
|
||||
from openpype.lib.remote_publish import (
|
||||
ERROR_STATUS,
|
||||
REPROCESS_STATUS,
|
||||
SENT_REPROCESSING_STATUS
|
||||
)
|
||||
|
||||
|
||||
log = Logger.get_logger("webserver_gui")
|
||||
|
||||
|
||||
def run_webserver(*args, **kwargs):
|
||||
"""Runs webserver in command line, adds routes."""
|
||||
from openpype.modules import ModulesManager
|
||||
|
||||
manager = ModulesManager()
|
||||
webserver_module = manager.modules_by_name["webserver"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue