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:
|
The principal function used to export an item's properties to an external file. |
Prompts the user to pick a file-load path. |
|
|
Get an informative json string to stamp a properties file. |
|
Returns the item's bookmark and asset table properties as a JSON strings. |
|
Prompts the user to pick a file-save path. |
|
The principal function used to import an item's properties from an external file. |
|
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.