added possiblity to set note with intent template through presets

This commit is contained in:
iLLiCiTiT 2020-02-18 14:05:02 +01:00
parent cc6d70f849
commit a3ad40e34a

View file

@ -10,6 +10,8 @@ class IntegrateFtrackNote(pyblish.api.InstancePlugin):
order = pyblish.api.IntegratorOrder + 0.4999
label = "Integrate Ftrack note"
families = ["ftrack"]
# Can be set in presets (Allows only `intent` and `comment` keys)
note_with_intent_template = "{intent}: {comment}"
optional = True
def process(self, instance):
@ -25,7 +27,10 @@ class IntegrateFtrackNote(pyblish.api.InstancePlugin):
msg = "Intent is set to `{}` and was added to comment.".format(
intent
)
comment = "{}: {}".format(intent, comment)
comment = note_with_intent_template.format(**{
"intent": intent,
"comment": comment
})
else:
msg = "Intent is not set."
self.log.debug(msg)