diff --git a/pype/ftrack/actions/action_application_loader.py b/pype/ftrack/actions/action_application_loader.py index ecf3575902..50714e4535 100644 --- a/pype/ftrack/actions/action_application_loader.py +++ b/pype/ftrack/actions/action_application_loader.py @@ -63,4 +63,4 @@ def register(session): time.sleep(0.1) app_counter += 1 except Exception as e: - log.warning("'{0}' - not proper App ({1})".format(app['name'], e)) + log.exception("'{0}' - not proper App ({1})".format(app['name'], e)) diff --git a/pype/ftrack/lib/ftrack_app_handler.py b/pype/ftrack/lib/ftrack_app_handler.py index ca5875b322..e4075e9a19 100644 --- a/pype/ftrack/lib/ftrack_app_handler.py +++ b/pype/ftrack/lib/ftrack_app_handler.py @@ -227,10 +227,10 @@ class AppAction(BaseHandler): except Exception: try: anatomy = anatomy.format(data) - work_template = anatomy["work"]["path"] + work_template = anatomy["work"]["folder"] except Exception as e: - self.log.error( + self.log.exception( "{0} Error in anatomy.format: {1}".format(__name__, e) ) os.environ["AVALON_WORKDIR"] = os.path.normpath(work_template) @@ -296,7 +296,7 @@ class AppAction(BaseHandler): try: fp = open(execfile) except PermissionError as p: - self.log.error('Access denied on {0} - {1}'.format( + self.log.exception('Access denied on {0} - {1}'.format( execfile, p)) return { 'success': False, diff --git a/pype/ftrack/lib/ftrack_base_handler.py b/pype/ftrack/lib/ftrack_base_handler.py index faba858792..7a04ba329c 100644 --- a/pype/ftrack/lib/ftrack_base_handler.py +++ b/pype/ftrack/lib/ftrack_base_handler.py @@ -81,7 +81,7 @@ class BaseHandler(object): self.type, label) ) except Exception as e: - self.log.error('{} "{}" - Registration failed ({})'.format( + self.log.exception('{} "{}" - Registration failed ({})'.format( self.type, label, str(e)) ) return wrapper_register @@ -104,7 +104,7 @@ class BaseHandler(object): return result except Exception as e: msg = '{} "{}": Failed ({})'.format(self.type, label, str(e)) - self.log.error(msg) + self.log.exception(msg) return { 'success': False, 'message': msg diff --git a/pype/plugins/global/publish/collect_assumed_destination.py b/pype/plugins/global/publish/collect_assumed_destination.py index 16a299d524..7458db6aa7 100644 --- a/pype/plugins/global/publish/collect_assumed_destination.py +++ b/pype/plugins/global/publish/collect_assumed_destination.py @@ -23,7 +23,7 @@ class CollectAssumedDestination(pyblish.api.InstancePlugin): anatomy = instance.context.data['anatomy'] # self.log.info(anatomy.anatomy()) - self.log.info(anatomy.anatomy) + self.log.info(anatomy.templates) # template = anatomy.publish.path anatomy_filled = anatomy.format(template_data) self.log.info(anatomy_filled) @@ -137,5 +137,5 @@ class CollectAssumedDestination(pyblish.api.InstancePlugin): # We take the parent folder of representation 'filepath' instance.data["assumedDestination"] = os.path.dirname( - (anatomy.format(template_data)).publish.path + (anatomy.format(template_data))["publish"]["path"] ) diff --git a/pype/plugins/global/publish/collect_templates.py b/pype/plugins/global/publish/collect_templates.py index fb6de894bd..b59b20892b 100644 --- a/pype/plugins/global/publish/collect_templates.py +++ b/pype/plugins/global/publish/collect_templates.py @@ -1,5 +1,6 @@ import pype.api as pype +from pypeapp import Anatomy import pyblish.api @@ -11,6 +12,6 @@ class CollectTemplates(pyblish.api.ContextPlugin): label = "Collect Templates" def process(self, context): - pype.load_data_from_templates() - context.data['anatomy'] = pype.Anatomy + # pype.load_data_from_templates() + context.data['anatomy'] = Anatomy() self.log.info("Anatomy templates collected...") diff --git a/pype/plugins/global/publish/integrate.py b/pype/plugins/global/publish/integrate.py index 00096a95ee..fce9d26220 100644 --- a/pype/plugins/global/publish/integrate.py +++ b/pype/plugins/global/publish/integrate.py @@ -210,10 +210,10 @@ class IntegrateAsset(pyblish.api.InstancePlugin): src = os.path.join(stagingdir, fname) anatomy_filled = anatomy.format(template_data) - dst = anatomy_filled.publish.path + dst = anatomy_filled["publish"]["path"] instance.data["transfers"].append([src, dst]) - template = anatomy.publish.path + template = anatomy.templates["publish"]["path"] else: # Single file @@ -234,10 +234,10 @@ class IntegrateAsset(pyblish.api.InstancePlugin): src = os.path.join(stagingdir, fname) anatomy_filled = anatomy.format(template_data) - dst = anatomy_filled.publish.path + dst = anatomy_filled["publish"]["path"] instance.data["transfers"].append([src, dst]) - template = anatomy.publish.path + template = anatomy.templates["publish"]["path"] representation = { "schema": "pype:representation-2.0", diff --git a/pype/plugins/global/publish/validate_templates.py b/pype/plugins/global/publish/validate_templates.py index 5611a6f1f0..a2c7b24ac1 100644 --- a/pype/plugins/global/publish/validate_templates.py +++ b/pype/plugins/global/publish/validate_templates.py @@ -1,4 +1,5 @@ import pyblish.api +import os class ValidateTemplates(pyblish.api.ContextPlugin): """Check if all templates were filed""" @@ -13,25 +14,28 @@ class ValidateTemplates(pyblish.api.ContextPlugin): if not anatomy: raise RuntimeError("Did not find anatomy") else: - data = { "project": {"name": "D001_projectsx", + data = { + "root": os.environ["PYPE_STUDIO_PROJECTS_PATH"], + "project": {"name": "D001_projectsx", "code": "prjX"}, - "representation": "exr", + "ext": "exr", "version": 3, "task": "animation", "asset": "sh001", "hierarchy": "ep101/sq01/sh010"} - anatomy = context.data["anatomy"].format(data) - self.log.info(anatomy["work"]["path"]) + anatomy_filled = anatomy.format(data) + self.log.info(anatomy_filled) - data = { "project": {"name": "D001_projectsy", + data = {"root": os.environ["PYPE_STUDIO_PROJECTS_PATH"], + "project": {"name": "D001_projectsy", "code": "prjY"}, - "representation": "abc", + "ext": "abc", "version": 1, "task": "lookdev", "asset": "bob", "hierarchy": "ep101/sq01/bob"} - anatomy = context.data["anatomy"].format(data) - self.log.info(anatomy["work"]["file"]) + anatomy_filled = context.data["anatomy"].format(data) + self.log.info(anatomy_filled["work"]["folder"])