hooks.tk-multi-publish2.basic.start_version_control module

class KatanaStartVersionControlPlugin(*args, **kwargs)

Bases: sphinx.ext.autodoc.importer._MockObject

Simple plugin to insert a version number into the katana file path if one does not exist.

accept(settings, item)

Method called by the publisher to determine if an item is of any interest to this plugin. Only items matching the filters defined via the item_filters property will be presented to this method.

A publish task will be generated for each item accepted here. Returns a dictionary with the following booleans:

  • accepted: Indicates if the plugin is interested in this value at
    all. Required.
  • enabled: If True, the plugin will be enabled in the UI, otherwise
    it will be disabled. Optional, True by default.
  • visible: If True, the plugin will be visible in the UI, otherwise
    it will be hidden. Optional, True by default.
  • checked: If True, the plugin will be checked in the UI, otherwise
    it will be unchecked. Optional, True by default.
Parameters:
  • settings – Dictionary of Settings. The keys are strings, matching the keys returned in the settings property. The values are Setting instances.
  • item – Item to process
Returns:

dictionary with boolean keys accepted, required and enabled

description

Verbose, multi-line description of what the plugin does. This can contain simple html for formatting.

finalize(settings, item)

Execute the finalization pass. This pass executes once all the publish tasks have completed, and can for example be used to version up files.

Parameters:
  • settings – Dictionary of Settings. The keys are strings, matching the keys returned in the settings property. The values are Setting instances.
  • item – Item to process
icon

Path to an png icon on disk

item_filters

List of item types that this plugin is interested in.

Only items matching entries in this list will be presented to the accept() method. Strings can contain glob patters such as , for example [“katana.”, “file.katana”]

name

One line display name describing the plugin

publish(settings, item)

Executes the publish logic for the given item and settings.

Parameters:
  • settings – Dictionary of Settings. The keys are strings, matching the keys returned in the settings property. The values are Setting instances.
  • item – Item to process
settings

Dictionary defining the settings that this plugin expects to receive through the settings parameter in the accept, validate, publish and finalize methods.

A dictionary on the following form:

{
    "Settings Name": {
        "type": "settings_type",
        "default": "default_value",
        "description": "One line description of the setting"
}

The type string should be one of the data types that toolkit accepts as part of its environment configuration.

validate(settings, item)

Validates the given item to check that it is ok to publish.

Returns a boolean to indicate validity.

Parameters:
  • settings – Dictionary of Settings. The keys are strings, matching the keys returned in the settings property. The values are Setting instances.
  • item – Item to process
Returns:

True if item is valid, False otherwise.