Pyblish By Example
1.8
1.8
  • Introduction
  • Hello World
  • Quickstart
  • Files
  • Coordination
  • Architecture
  • Branching I
  • Branching II
  • Branching III
  • Sharing
  • Validating I
  • Validating II
  • CVEI I
  • CVEI II
  • CVEI III
  • CVEI IV
  • Data
  • Report I
  • Report II
  • Report III
  • Report IV
  • Report V
  • Callback I
  • Callback II
  • Callback III
  • Logging
  • Filtering
  • Next Steps
Powered by GitBook
On this page

Was this helpful?

Callback I

PreviousReport VNextCallback II

Last updated 5 years ago

Was this helpful?

Sometimes you may be interested in an event taking place at a particular location during processing.

import pyblish.api

def on_published(context):
  has_error = any(result["error"] is not None for result in context.data["results"])
  print("Publishing %s" % ("failed" if has_error else "finished"))

pyblish.api.register_callback("published", on_published)

This will cause "Publishing finished" or "Publishing failed" to be printed upon completed publishing, based on whether it completed successfully or not.

The arguments provided by the signal must match those in your callback. See for a complete list of signals emitted in Pyblish.

here
Events