publish#

This modules defines the widget and methods needed for a simple publish flow.

This currently entails

Classes:

PublishWidget(index[, parent])

Publishes a footage.

TaskComboBox([parent])

Task picker.

TaskModel([parent])

TemplateComboBox([parent])

Publish template picker.

TemplateModel([parent])

Model used to list all available publish templates.

Functions:

close()

Closes the PublishWidget editor.

get_payload(kwargs, destination)

Get the payload for the publish process.

show(index)

Shows the PublishWidget editor.

Data:

SECTIONS

UI layout definition

class bookmarks.publish.PublishWidget(index, parent=None)[source]#

Bases: BasePropertyEditor

Publishes a footage.

Methods:

copy_payload_files([payload])

Copy files based on the given payload.

db_source()

A file path to use as the source of database values.

get_publish_kwargs(**_kwargs)

Get the list of properties needed to publish the item.

guess_task_and_element()

Guess the task and element name from the input source file name.

init_data()

Initializes data.

init_progress_bar()

Initializes the progress bar.

init_thumbnail()

Load the item's current thumbnail.

make_jpegs(payload)

Convert the source image files to a jpeg sequence.

make_videos(destination, jpegs[, payload])

Create videos from the source images.

post_publish(destination, kwargs)

Post publish actions.

post_teams_message(destination, kwargs[, ...])

Post-publish Teams notification action.

prepare_publish(destination[, payload])

Prepare the destination directory for publishing.

save_changes()

Saves changes.

save_thumbnail(destination[, payload])

Saves the current thumbnail to the publish folder.

set_source_text()

Set source item label.

update_expanded_template()

Slot connected to the update timer used to preview the output file name.

write_manifest(destination[, payload])

Write an informative manifest file with information about this publish.

copy_payload_files(payload=None)[source]#

Copy files based on the given payload.

Parameters:

payload (dict) – Payload data.

db_source()[source]#

A file path to use as the source of database values.

Returns:

The database source file.

Return type:

str

get_publish_kwargs(**_kwargs)[source]#

Get the list of properties needed to publish the item.

Parameters:

_kwargs (dict) – Dictionary of properties overrides.

Returns:

Dictionary of properties.

Return type:

dict

guess_task_and_element()[source]#

Guess the task and element name from the input source file name.

Publishing an element requires both the task and the element to be specified. The user can set these manually but if we can suggest them based on the input name we’ll set them for the user.

init_data()[source]#

Initializes data.

init_progress_bar()[source]#

Initializes the progress bar.

init_thumbnail()[source]#

Load the item’s current thumbnail.

make_jpegs(payload)[source]#

Convert the source image files to a jpeg sequence.

Parameters:

payload (dict) – The payload data used to publish the item.

Returns:

A list of file paths of the created jpeg files, or None.

Return type:

list

make_videos(destination, jpegs, payload=None)[source]#

Create videos from the source images.

Parameters:
  • destination (str) – Publish destination path.

  • jpegs (list) – A list of file paths of previously created jpeg images.

  • payload (dict) – Optional. A dictionary of payload data.

post_publish(destination, kwargs)[source]#

Post publish actions.

Parameters:
  • destination (str) – Publish destination path.

  • kwargs (dict, optional) – Optional. Dictionary of payload data.

post_teams_message(destination, kwargs, payload=None)[source]#

Post-publish Teams notification action.

prepare_publish(destination, payload=None)[source]#

Prepare the destination directory for publishing.

save_changes()[source]#

Saves changes.

save_thumbnail(destination, payload=None)[source]#

Saves the current thumbnail to the publish folder.

set_source_text()[source]#

Set source item label.

update_expanded_template()[source]#

Slot connected to the update timer used to preview the output file name.

write_manifest(destination, payload=None)[source]#

Write an informative manifest file with information about this publish.

Parameters:
  • destination (str) – Publish destination path.

  • payload (dict, optional) – Optional. Dictionary of payload data.

class bookmarks.publish.TaskComboBox(parent=None)[source]#

Bases: QComboBox

Task picker.

class bookmarks.publish.TaskModel(parent=None)[source]#

Bases: AbstractListModel

Methods:

add_item(task)

Adds a new task item.

init_data()

Initializes data.

add_item(task)[source]#

Adds a new task item.

init_data()[source]#

Initializes data.

class bookmarks.publish.TemplateComboBox(parent=None)[source]#

Bases: QComboBox

Publish template picker.

class bookmarks.publish.TemplateModel(parent=None)[source]#

Bases: AbstractListModel

Model used to list all available publish templates.

Methods:

init_data()

Initializes data.

init_data()[source]#

Initializes data.

bookmarks.publish.close()[source]#

Closes the PublishWidget editor.

bookmarks.publish.get_payload(kwargs, destination)[source]#

Get the payload for the publish process.

Parameters:
  • kwargs (dict) – A list of keyword arguments.

  • destination (str) – The destination path.

Returns:

The payload information used to publish the item.

Return type:

dict

bookmarks.publish.show(index)[source]#

Shows the PublishWidget editor.

bookmarks.publish.SECTIONS = {0: {'color': PySide2.QtGui.QColor.fromRgbF(0.254902, 0.254902, 0.254902, 1.000000), 'groups': {0: {0: {'description': 'Source file path', 'key': 'source', 'name': 'Source', 'placeholder': '', 'validator': None, 'widget': <class 'PySide2.QtWidgets.QLabel'>}, 1: {'description': 'Final output path', 'key': 'destination', 'name': 'Destination', 'placeholder': '', 'validator': None, 'widget': <class 'PySide2.QtWidgets.QLabel'>}}}, 'icon': None, 'name': None}, 1: {'color': PySide2.QtGui.QColor.fromRgbF(0.254902, 0.254902, 0.254902, 1.000000), 'groups': {0: {0: {'description': 'Select the publish template', 'key': 'publish/template', 'name': 'Publish Template', 'placeholder': None, 'validator': None, 'widget': <class 'bookmarks.publish.TemplateComboBox'>}, 1: {'button1': 'Custom', 'description': 'Select the publish template', 'key': 'publish/task', 'name': 'Task', 'placeholder': None, 'validator': None, 'widget': <class 'bookmarks.publish.TaskComboBox'>}, 2: {'description': 'A short description of this file publish.\nIndicate significant changes and notes here.', 'key': 'description', 'name': 'Description', 'placeholder': 'Enter a short description here...', 'validator': None, 'widget': <class 'bookmarks.ui.LineEdit'>}, 3: {'description': "The name of the element being published. E.g., 'ForegroundTower', or 'BackgroundElements'", 'key': 'element', 'name': 'Specify Element', 'placeholder': "The element being published, e.g. 'CastleInterior'", 'validator': <PySide2.QtGui.QRegExpValidator(0x2a201bce520)>, 'widget': <class 'bookmarks.ui.LineEdit'>}}}, 'icon': None, 'name': 'Template'}, 2: {'color': PySide2.QtGui.QColor.fromRgbF(0.254902, 0.254902, 0.254902, 1.000000), 'groups': {0: {0: {'description': 'Copy the path to the clipboard after finish.', 'key': 'publish/copy_path', 'name': 'Copy Path to Clipboard', 'placeholder': None, 'validator': None, 'widget': functools.partial(<class 'PySide2.QtWidgets.QCheckBox'>, 'Enable')}, 1: {'description': 'Reveal the published files in the explorer.', 'key': 'publish/reveal', 'name': 'Reveal Publish', 'placeholder': None, 'validator': None, 'widget': functools.partial(<class 'PySide2.QtWidgets.QCheckBox'>, 'Enable')}, 2: {'description': 'Send a notification of the publish to a Teams channel.', 'key': 'publish/teams_notification', 'name': 'Teams Notification', 'placeholder': None, 'validator': None, 'widget': functools.partial(<class 'PySide2.QtWidgets.QCheckBox'>, 'Enable')}}}, 'icon': None, 'name': 'Post-Publish'}}#

UI layout definition