importexport#

Property export and import functions.

This module can export bookmark and asset item properties to external files. The files themselves are zip files made up of a manifest.json, bookmark_table_properties.json asset_table_properties.json and a thumbnail file. See the main export function export_item_properties(), and the main import function import_item_properties() for details.

Functions:

export_item_properties(index[, destination])

The principal function used to export an item's properties to an external file.

get_load_path()

Prompts the user to pick a file-load path.

get_manifest_data(index)

Get an informative json string to stamp a properties file.

get_properties_as_json(index)

Returns the item's bookmark and asset table properties as a JSON strings.

get_save_path(name)

Prompts the user to pick a file-save path.

import_item_properties(index[, source, prompt])

The principal function used to import an item's properties from an external file.

verify_zip_file(path, item_type)

Verifies the given preset file against the given item type.

bookmarks.importexport.export_item_properties(index, destination=None)[source]#

The principal function used to export an item’s properties to an external file.

Parameters:
  • index (QtCore.QModelIndex) – An item index.

  • destination (str) – Optional path to a file. If not provided, the user will be prompted to select a destination a file.

bookmarks.importexport.get_load_path()[source]#

Prompts the user to pick a file-load path.

Returns:

Path to the file to load.

Return type:

str

bookmarks.importexport.get_manifest_data(index)[source]#

Get an informative json string to stamp a properties file.

Parameters:

index (QtCore.QModelIndex) – An item index.

Returns:

Manifest data as a JSON string.

Return type:

str

bookmarks.importexport.get_properties_as_json(index)[source]#

Returns the item’s bookmark and asset table properties as a JSON strings.

Parameters:

index (QtCore.QModelIndex) – An item index.

Returns:

The bookmark and asset table properties of the item.

Return type:

tuple (str, str)

bookmarks.importexport.get_save_path(name)[source]#

Prompts the user to pick a file-save path.

Parameters:

name (str) – The item’s display name.

Returns:

The path to save the item.

Return type:

str

bookmarks.importexport.import_item_properties(index, source=None, prompt=True)[source]#

The principal function used to import an item’s properties from an external file.

Parameters:
  • index (QtCore.QModelIndex) – An item index.

  • source (str) – Path to a preset file. Optional.

  • prompt (bool) – Show prompt before overriding.

bookmarks.importexport.verify_zip_file(path, item_type)[source]#

Verifies the given preset file against the given item type.