API
1.6
1.6
  • Introduction
  • Plug-in System
  • Data
    • result
    • Events
    • Targets
  • Environment Variables
    • PYBLISHPLUGINPATH
    • PYBLISH_CLIENT_PORT
    • PYBLISH_ALLOW_DUPLICATE_PLUGINS
    • PYBLISH_GUI
    • PYBLISH_EARLY_ADOPTER
    • PYBLISH_STRICT_DATATYPES
  • Ordering
    • CollectorOrder
    • ValidatorOrder
    • ExtractorOrder
    • IntegratorOrder
  • pyblish.util
    • publish
    • collect
    • validate
    • extract
    • integrate
  • pyblish.cli
    • publish
  • pyblish.api
    • AbstractEntity
      • .data
    • Context
      • .append
      • .create_instance
    • Instance
      • .append
      • .context
    • Plugin
      • .hosts
      • .families
      • .label
      • .active
      • .order
      • .optional
      • .requires
      • .actions
      • .version
      • .match
    • ContextPlugin
      • .process
    • InstancePlugin
      • .process
    • Action
      • .process
      • .icon
      • .on
    • Category
    • Separator
    • discover
    • sort
    • register_gui
    • register_host
Powered by GitBook
On this page
  • Overview
  • Example
  • Full schema

Was this helpful?

  1. Data

result

The result dictionary is produced once per process and contains information about what happened, primarily intended for use in graphical user interfaces.

Overview

These members are available in each result produced.

{
    success: "Status of processing."
    instance: "Name of processed instance or null if no instance were processed."
    plugin: "Instance of current plug-in at the time."
    duration: "Time in milliseconds taken to process a pair."
    error: "Instance of exception thrown (if any)."
    records: "List of log messages made."
}

Example

import pyblish.util
context = pyblish.util.publish()

for result in context.data["results"]:
  print("Success!" if result["success"] else "Failed..")

  # All log messages are captured in `records`
  for record in result["records"]:
    print(record)

Full schema

{
    "$schema": "http://json-schema.org/schema#",

    "title": "Result",
    "description": "Result from processing a (plugin, instance) pair",

    "type": "object",

    "additionalProperties": false,

    "properties": {
        "success": {
            "description": "Status of processing",
            "type": "boolean"
        },
        "instance": {
            "description": "Name of processed instance or null if no instance were processed",
            "oneOf": [
                {"$ref": "instance.json"},
                {"type": "null"}
            ]
        },
        "plugin": {
            "oneOf": [
                {"$ref": "plugin.json"},
                {"type": "null"}
            ]
        },
        "duration": {
            "description": "Time in milliseconds taken to process a pair",
            "type": "number"
        },
        "error": {
            "oneOf": [
                {"$ref": "error.json"},
                {"type": "null"}
            ]
        },
        "records": {
            "type": "array",
            "items": {
                "$ref": "record.json"
            }
        }
    },

    "definitions": {}
}

{{ file.mtime }}

PreviousDataNextEvents

Last updated 5 years ago

Was this helpful?

Snapshot from

result.json
All schemas
1a350