mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
ftrack sync can use application manager for applications sync
This commit is contained in:
parent
7174dc16ef
commit
cc70fd7552
1 changed files with 21 additions and 2 deletions
|
|
@ -17,7 +17,10 @@ from bson.errors import InvalidId
|
||||||
from pymongo import UpdateOne
|
from pymongo import UpdateOne
|
||||||
import ftrack_api
|
import ftrack_api
|
||||||
from pype.api import config
|
from pype.api import config
|
||||||
|
from pype.lib import (
|
||||||
|
ApplicationManager,
|
||||||
|
env_value_to_bool
|
||||||
|
)
|
||||||
|
|
||||||
log = Logger().get_logger(__name__)
|
log = Logger().get_logger(__name__)
|
||||||
|
|
||||||
|
|
@ -186,12 +189,28 @@ def get_project_apps(in_app_list):
|
||||||
dictionary of warnings
|
dictionary of warnings
|
||||||
"""
|
"""
|
||||||
apps = []
|
apps = []
|
||||||
|
warnings = collections.defaultdict(list)
|
||||||
|
|
||||||
|
if env_value_to_bool("PYPE_USE_APP_MANAGER", default=False):
|
||||||
|
missing_app_msg = "Missing definition of application"
|
||||||
|
application_manager = ApplicationManager()
|
||||||
|
for app_name in in_app_list:
|
||||||
|
app = application_manager.applications.get(app_name)
|
||||||
|
if app:
|
||||||
|
apps.append({
|
||||||
|
"name": app_name,
|
||||||
|
"label": app.full_label
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
warnings[missing_app_msg].append(app_name)
|
||||||
|
return apps, warnings
|
||||||
|
|
||||||
# TODO report
|
# TODO report
|
||||||
missing_toml_msg = "Missing config file for application"
|
missing_toml_msg = "Missing config file for application"
|
||||||
error_msg = (
|
error_msg = (
|
||||||
"Unexpected error happend during preparation of application"
|
"Unexpected error happend during preparation of application"
|
||||||
)
|
)
|
||||||
warnings = collections.defaultdict(list)
|
|
||||||
for app in in_app_list:
|
for app in in_app_list:
|
||||||
try:
|
try:
|
||||||
toml_path = avalon.lib.which_app(app)
|
toml_path = avalon.lib.which_app(app)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue