mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Simplified querying status of ProjectPushItemProcess
Makes error logging more stable, limits hard fails in debugger.
This commit is contained in:
parent
4229950f36
commit
2bd5418cae
3 changed files with 11 additions and 21 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import threading
|
||||
from typing import Dict
|
||||
|
||||
import ayon_api
|
||||
|
||||
|
|
@ -13,6 +14,7 @@ from .models import (
|
|||
UserPublishValuesModel,
|
||||
IntegrateModel,
|
||||
)
|
||||
from .models.integrate import ProjectPushItemProcess
|
||||
|
||||
|
||||
class PushToContextController:
|
||||
|
|
@ -171,8 +173,9 @@ class PushToContextController:
|
|||
def set_selected_task(self, task_id, task_name):
|
||||
self._selection_model.set_selected_task(task_id, task_name)
|
||||
|
||||
def get_process_item_status(self, item_id):
|
||||
return self._integrate_model.get_item_status(item_id)
|
||||
def get_process_items(self) -> Dict[str, ProjectPushItemProcess]:
|
||||
"""Returns dict of all ProjectPushItemProcess items """
|
||||
return self._integrate_model.get_items()
|
||||
|
||||
# Processing methods
|
||||
def submit(self, wait=True):
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import itertools
|
|||
import sys
|
||||
import traceback
|
||||
import uuid
|
||||
from typing import Optional
|
||||
from typing import Optional, Dict
|
||||
|
||||
import ayon_api
|
||||
from ayon_api.utils import create_entity_id
|
||||
|
|
@ -1281,17 +1281,6 @@ class IntegrateModel:
|
|||
return
|
||||
item.integrate()
|
||||
|
||||
def get_item_status(self, item_id):
|
||||
"""Status of an item.
|
||||
|
||||
Args:
|
||||
item_id (str): Item id for which status should be returned.
|
||||
|
||||
Returns:
|
||||
dict[str, Any]: Status data.
|
||||
"""
|
||||
|
||||
item = self._process_items.get(item_id)
|
||||
if item is not None:
|
||||
return item.get_status_data()
|
||||
return None
|
||||
def get_items(self) -> Dict[str, ProjectPushItemProcess]:
|
||||
"""Returns dict of all ProjectPushItemProcess items """
|
||||
return self._process_items
|
||||
|
|
|
|||
|
|
@ -528,10 +528,8 @@ class PushToContextSelectWindow(QtWidgets.QWidget):
|
|||
|
||||
failed_pushes = []
|
||||
fail_tracebacks = []
|
||||
for process_item_id in self._controller._process_item_ids:
|
||||
process_status = self._controller.get_process_item_status(
|
||||
process_item_id
|
||||
)
|
||||
for process_item in self._controller.get_process_items().values():
|
||||
process_status = process_item.get_status_data()
|
||||
if process_status["failed"]:
|
||||
failed_pushes.append(process_status)
|
||||
# push_failed = process_status["failed"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue