New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement support for adding a comment #232

Merged
merged 10 commits into from May 25, 2017

Conversation

Projects
None yet
1 participant
@mottosso
Member

mottosso commented May 23, 2017

This PR enables the user to include a comment with his publish.

comment_basics

Implements #9.

Format

Comments made via the editor is stored in the comment data member of the context, as a single block of text.

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.

Features

  • Automatically show comment on presence of context.data["comment"]
  • Remember comment across resets
  • Dedicated signal commented for optional data persistence
  • Maximisable, type out your excellent comment in fullscreen
  • Comment template, provide users with a starting point of guidelines for their comment.

comment_fullscreen

comment_persistence
Signal

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

@mottosso mottosso referenced this pull request May 23, 2017

Merged

Implement commenting #139

@mottosso mottosso merged commit 84cc26c into pyblish:master May 25, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment