diff --git a/pype/ftrack/actions/action_syncToAvalon.py b/pype/ftrack/actions/action_syncToAvalon.py index f7fd8e9641..f612e03d43 100644 --- a/pype/ftrack/actions/action_syncToAvalon.py +++ b/pype/ftrack/actions/action_syncToAvalon.py @@ -11,7 +11,7 @@ from pype import lib from ftrack_action_handler import BaseAction from bson.objectid import ObjectId from avalon import io, inventory -from avalon.vendor import toml + from pype.ftrack import ftrack_utils class SyncToAvalon(BaseAction): diff --git a/pype/ftrack/ftrack_utils.py b/pype/ftrack/ftrack_utils.py index 27bf49d7d1..f2e2dd6d84 100644 --- a/pype/ftrack/ftrack_utils.py +++ b/pype/ftrack/ftrack_utils.py @@ -4,10 +4,10 @@ from pprint import * import ftrack_api from pype import lib - import avalon.io as io import avalon.api import avalon +from avalon.vendor import toml from app.api import Logger log = Logger.getLogger(__name__) @@ -59,10 +59,17 @@ def get_apps(entity): apps = [] for app in entity['custom_attributes']['applications']: try: - label = toml.load(lib.which_app(app))['label'] - apps.append({'name':app, 'label':label}) + app_config = {} + app_file = toml.load(avalon.lib.which_app(app)) + app_config['name'] = app + app_config['label'] = app_file['label'] + if 'ftrack_label' in app_file: + app_config['ftrack_label'] = app_file['ftrack_label'] + + apps.append(app_config) + except Exception as e: - print('Error with application {0} - {1}'.format(app, e)) + log.warning('Error with application {0} - {1}'.format(app, e)) return apps def get_config(entity):