mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
more readable code
This commit is contained in:
parent
e271b06c9f
commit
29825b6d0e
1 changed files with 13 additions and 18 deletions
|
|
@ -898,29 +898,24 @@ class PublishModel:
|
|||
|
||||
def get_next_process_func(self) -> partial:
|
||||
# Validations of progress before using iterator
|
||||
# - same conditions may be inside iterator but they may be used
|
||||
# only in specific cases (e.g. when it happens for a first time)
|
||||
# Any unexpected error happened
|
||||
# - everything should stop
|
||||
if self._publish_has_crashed:
|
||||
return partial(self.stop_publish)
|
||||
|
||||
# Stop if validation is over and validation errors happened
|
||||
# or publishing should stop at validation
|
||||
if (
|
||||
# Any unexpected error happened
|
||||
# - everything should stop
|
||||
self._publish_has_crashed
|
||||
# Stop if validation is over and validation errors happened
|
||||
# or publishing should stop at validation
|
||||
or (
|
||||
self._publish_has_validated
|
||||
and (
|
||||
self._publish_has_validation_errors
|
||||
or self._publish_up_validation
|
||||
)
|
||||
self._publish_has_validated
|
||||
and (
|
||||
self._publish_has_validation_errors
|
||||
or self._publish_up_validation
|
||||
)
|
||||
):
|
||||
item = partial(self.stop_publish)
|
||||
return partial(self.stop_publish)
|
||||
|
||||
# Everything is ok so try to get new processing item
|
||||
else:
|
||||
item = next(self._main_thread_iter)
|
||||
|
||||
return item
|
||||
return next(self._main_thread_iter)
|
||||
|
||||
def stop_publish(self):
|
||||
if self._publish_is_running:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue