diff --git a/openpype/modules/webserver/webpublish_routes.py b/openpype/hosts/webpublisher/webserver_service/webpublish_routes.py similarity index 100% rename from openpype/modules/webserver/webpublish_routes.py rename to openpype/hosts/webpublisher/webserver_service/webpublish_routes.py diff --git a/openpype/modules/webserver/webserver_cli.py b/openpype/hosts/webpublisher/webserver_service/webserver_cli.py similarity index 52% rename from openpype/modules/webserver/webserver_cli.py rename to openpype/hosts/webpublisher/webserver_service/webserver_cli.py index 24bd28ba7d..b1c14260e9 100644 --- a/openpype/modules/webserver/webserver_cli.py +++ b/openpype/hosts/webpublisher/webserver_service/webserver_cli.py @@ -19,7 +19,6 @@ from .webpublish_routes import ( from openpype.api import get_system_settings -# SERVER_URL = "http://172.17.0.1:8079" # machine is not listening on localhost log = PypeLogger().get_logger("webserver_gui") @@ -32,72 +31,62 @@ def run_webserver(*args, **kwargs): webserver_module = manager.modules_by_name["webserver"] webserver_module.create_server_manager() - is_webpublish_enabled = False - webpublish_tool = get_system_settings()["modules"].\ - get("webpublish_tool") + resource = RestApiResource(webserver_module.server_manager, + upload_dir=kwargs["upload_dir"], + executable=kwargs["executable"]) + projects_endpoint = WebpublisherProjectsEndpoint(resource) + webserver_module.server_manager.add_route( + "GET", + "/api/projects", + projects_endpoint.dispatch + ) - if webpublish_tool and webpublish_tool["enabled"]: - is_webpublish_enabled = True + hiearchy_endpoint = WebpublisherHiearchyEndpoint(resource) + webserver_module.server_manager.add_route( + "GET", + "/api/hierarchy/{project_name}", + hiearchy_endpoint.dispatch + ) - log.debug("is_webpublish_enabled {}".format(is_webpublish_enabled)) - if is_webpublish_enabled: - resource = RestApiResource(webserver_module.server_manager, - upload_dir=kwargs["upload_dir"], - executable=kwargs["executable"]) - projects_endpoint = WebpublisherProjectsEndpoint(resource) - webserver_module.server_manager.add_route( - "GET", - "/api/projects", - projects_endpoint.dispatch - ) + # triggers publish + webpublisher_task_publish_endpoint = \ + WebpublisherBatchPublishEndpoint(resource) + webserver_module.server_manager.add_route( + "POST", + "/api/webpublish/batch", + webpublisher_task_publish_endpoint.dispatch + ) - hiearchy_endpoint = WebpublisherHiearchyEndpoint(resource) - webserver_module.server_manager.add_route( - "GET", - "/api/hierarchy/{project_name}", - hiearchy_endpoint.dispatch - ) + webpublisher_batch_publish_endpoint = \ + WebpublisherTaskPublishEndpoint(resource) + webserver_module.server_manager.add_route( + "POST", + "/api/webpublish/task", + webpublisher_batch_publish_endpoint.dispatch + ) - # triggers publish - webpublisher_task_publish_endpoint = \ - WebpublisherBatchPublishEndpoint(resource) - webserver_module.server_manager.add_route( - "POST", - "/api/webpublish/batch", - webpublisher_task_publish_endpoint.dispatch - ) + # reporting + openpype_resource = OpenPypeRestApiResource() + batch_status_endpoint = BatchStatusEndpoint(openpype_resource) + webserver_module.server_manager.add_route( + "GET", + "/api/batch_status/{batch_id}", + batch_status_endpoint.dispatch + ) - webpublisher_batch_publish_endpoint = \ - WebpublisherTaskPublishEndpoint(resource) - webserver_module.server_manager.add_route( - "POST", - "/api/webpublish/task", - webpublisher_batch_publish_endpoint.dispatch - ) - - # reporting - openpype_resource = OpenPypeRestApiResource() - batch_status_endpoint = BatchStatusEndpoint(openpype_resource) - webserver_module.server_manager.add_route( - "GET", - "/api/batch_status/{batch_id}", - batch_status_endpoint.dispatch - ) - - user_status_endpoint = PublishesStatusEndpoint(openpype_resource) - webserver_module.server_manager.add_route( - "GET", - "/api/publishes/{user}", - user_status_endpoint.dispatch - ) + user_status_endpoint = PublishesStatusEndpoint(openpype_resource) + webserver_module.server_manager.add_route( + "GET", + "/api/publishes/{user}", + user_status_endpoint.dispatch + ) webserver_module.start_server() last_reprocessed = time.time() while True: - if is_webpublish_enabled: - if time.time() - last_reprocessed > 20: - reprocess_failed(kwargs["upload_dir"]) - last_reprocessed = time.time() + if time.time() - last_reprocessed > 20: + reprocess_failed(kwargs["upload_dir"]) + last_reprocessed = time.time() time.sleep(1.0) diff --git a/openpype/pype_commands.py b/openpype/pype_commands.py index d288e9f2a3..e0cab962f6 100644 --- a/openpype/pype_commands.py +++ b/openpype/pype_commands.py @@ -42,9 +42,8 @@ class PypeCommands: @staticmethod def launch_webpublisher_webservercli(*args, **kwargs): - from openpype.modules.webserver.webserver_cli import ( - run_webserver - ) + from openpype.hosts.webpublisher.webserver_service.webserver_cli \ + import (run_webserver) return run_webserver(*args, **kwargs) @staticmethod @@ -53,7 +52,7 @@ class PypeCommands: standalonepublish.main() @staticmethod - def publish(paths, targets=None, host=None): + def publish(paths, targets=None): """Start headless publishing. Publish use json from passed paths argument. diff --git a/openpype/settings/defaults/system_settings/modules.json b/openpype/settings/defaults/system_settings/modules.json index 1005f8d16b..3a70b90590 100644 --- a/openpype/settings/defaults/system_settings/modules.json +++ b/openpype/settings/defaults/system_settings/modules.json @@ -167,9 +167,6 @@ "standalonepublish_tool": { "enabled": true }, - "webpublish_tool": { - "enabled": false - }, "project_manager": { "enabled": true }, diff --git a/openpype/settings/entities/schemas/system_schema/schema_modules.json b/openpype/settings/entities/schemas/system_schema/schema_modules.json index 8cd729d2a1..75c08b2cd9 100644 --- a/openpype/settings/entities/schemas/system_schema/schema_modules.json +++ b/openpype/settings/entities/schemas/system_schema/schema_modules.json @@ -197,20 +197,6 @@ } ] }, - { - "type": "dict", - "key": "webpublish_tool", - "label": "Web Publish", - "collapsible": true, - "checkbox_key": "enabled", - "children": [ - { - "type": "boolean", - "key": "enabled", - "label": "Enabled" - } - ] - }, { "type": "dict", "key": "project_manager",