mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Raise PublishValidationError
This commit is contained in:
parent
4749ac8040
commit
68ab2fc934
3 changed files with 17 additions and 15 deletions
|
|
@ -1,5 +1,7 @@
|
|||
import pyblish.api
|
||||
|
||||
from openpype.pipeline.publish import PublishValidationError
|
||||
|
||||
|
||||
class ValidateFileSequences(pyblish.api.ContextPlugin):
|
||||
"""Validates whether any file sequences were collected."""
|
||||
|
|
@ -10,4 +12,5 @@ class ValidateFileSequences(pyblish.api.ContextPlugin):
|
|||
label = "Validate File Sequences"
|
||||
|
||||
def process(self, context):
|
||||
assert context, "Nothing collected."
|
||||
if not context:
|
||||
raise PublishValidationError("Nothing collected.")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import os
|
||||
import pyblish.api
|
||||
|
||||
from openpype.lib import filter_profiles
|
||||
from openpype.pipeline.publish import PublishValidationError
|
||||
|
||||
|
||||
class ValidateIntent(pyblish.api.ContextPlugin):
|
||||
|
|
@ -51,12 +51,10 @@ class ValidateIntent(pyblish.api.ContextPlugin):
|
|||
))
|
||||
return
|
||||
|
||||
msg = (
|
||||
"Please make sure that you select the intent of this publish."
|
||||
)
|
||||
|
||||
intent = context.data.get("intent") or {}
|
||||
self.log.debug(str(intent))
|
||||
intent_value = intent.get("value")
|
||||
if not intent_value:
|
||||
raise AssertionError(msg)
|
||||
raise PublishValidationError(
|
||||
"Please make sure that you select the intent of this publish."
|
||||
)
|
||||
|
|
|
|||
|
|
@ -47,15 +47,16 @@ class ValidatePublishDir(pyblish.api.InstancePlugin):
|
|||
# original_dirname must be convertable to rootless path
|
||||
# in other case it is path inside of root folder for the project
|
||||
success, _ = anatomy.find_root_template_from_path(original_dirname)
|
||||
|
||||
formatting_data = {
|
||||
"original_dirname": original_dirname,
|
||||
}
|
||||
msg = "Path '{}' not in project folder.".format(original_dirname) + \
|
||||
" Please publish from inside of project folder."
|
||||
if not success:
|
||||
raise PublishXmlValidationError(self, msg, key="not_in_dir",
|
||||
formatting_data=formatting_data)
|
||||
raise PublishXmlValidationError(
|
||||
plugin=self,
|
||||
message=(
|
||||
"Path '{}' not in project folder. Please publish from "
|
||||
"inside of project folder.".format(original_dirname)
|
||||
),
|
||||
key="not_in_dir",
|
||||
formatting_data={"original_dirname": original_dirname}
|
||||
)
|
||||
|
||||
def _get_template_name_from_instance(self, instance):
|
||||
"""Find template which will be used during integration."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue