> For the complete documentation index, see [llms.txt](https://learn.pyblish.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.pyblish.com/20-callback-i.md).

# Callback I

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

```python
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 [here](https://pyblish.gitbooks.io/api/content/pages/Events.html) for a complete list of signals emitted in Pyblish.

* [Events](https://pyblish.gitbooks.io/api/content/pages/Events.html)
