Join GitHub today
Implement support for adding a comment #232
This PR enables the user to include a comment with his publish.
Comments made via the editor is stored in the
context.data["comment"] = "Summary goes here\nDescription goes here, on a new line"
This is similar to comments on Git commits, the first line being dedicated to a short "summary" of your overall commit, with an (optional) longer description.
You can just add a summary, just add a description, or both. The first line always results in the first line of your comment.
A signal is emitted when entering a comment, so as to support data persistence, e.g. in Maya or on disk.
from pyblish import api def persist(comment): # write to disk here api.register_callback("commented", persist)
The comment can then be read via e.g. a Collector into the Context which would then become visible in the GUI.
from pyblish import api class CollectComment(api.ContextPlugin): order = api.CollectorOrder def process(self, context): context.data["comment"] = # read from disk here