GooglePlugin
GooglePlugin
flowchart LR
task_schema.plugins.google_plugin.GooglePlugin[GooglePlugin]
task_schema.plugins.base_plugin.BasePlugin[BasePlugin]
task_schema.plugins.base_studio.BaseCPlugin[BaseCPlugin]
task_schema.plugins.base_studio.BaseComponent[BaseComponent]
task_schema.plugins.base_plugin.BasePlugin --> task_schema.plugins.google_plugin.GooglePlugin
task_schema.plugins.base_studio.BaseCPlugin --> task_schema.plugins.base_plugin.BasePlugin
task_schema.plugins.base_studio.BaseComponent --> task_schema.plugins.base_studio.BaseCPlugin
click task_schema.plugins.google_plugin.GooglePlugin href "" "task_schema.plugins.google_plugin.GooglePlugin"
click task_schema.plugins.base_plugin.BasePlugin href "" "task_schema.plugins.base_plugin.BasePlugin"
click task_schema.plugins.base_studio.BaseCPlugin href "" "task_schema.plugins.base_studio.BaseCPlugin"
click task_schema.plugins.base_studio.BaseComponent href "" "task_schema.plugins.base_studio.BaseComponent"
Methods:
-
after_publish–Hook called after publishing process completes.
-
browse_note_data–This method should be overriden according to each plugin.
-
browse_task_data–This method should be overriden according to each plugin.
-
browse_version_data–This method should be overriden according to each plugin.
-
check_version_is_published–Determine whether a given version file has already been published.
-
collect_data–example: compile_code = ["B1",4,5]
-
copy_edl_files_to_server–Copy EDL-associated video and audio files to the server location.
-
create_assets_from_bdl–Receives an standarized dictionary that holds the data for creating assets.
-
create_dir_if_missing–Create a directory (and its defined subfolders) if it does not exist.
-
create_shot–Create a shot using parsed shot data.
-
create_thumbnail–This method may be overriden and it is called when the thumbnail
-
extract_plugin_values–Serialize plugin state and write it to a JSON file for debugging or inspection.
-
file_added_callback–This callback is added in case there is some further functionality to
-
file_has_convention–Check if a file meets entity and naming regex conventions.
-
file_has_entity–Check if the task entity is included in the file name (if required).
-
filter_local_files–Given a path, it will return the files
-
generate_environment_for_app–Generate environment variables needed to launch an external application.
-
get_plugin_info–Return a dictionary with lists of method names and variable names.
-
get_task_filesystem–Utility function for returning the filesystem of a given task.
-
guess_executable_for_file–Guess which executable should be used to open a file based on its extension.
-
load–Load a Component configuration from dict.
-
local_to_server–Converts the local path to server path.
-
on_item_doubleclicked_callback–Placeholder for handling item double-click behavior in a GUI context.
-
open_app_with_env–Launch an application with generated environment variables.
-
open_file_with_env–Open a file with a specified executable and plugin-defined environment.
-
open_sheet–link (str): sheet's name or sheet's link
-
open_worksheet–worksheet (int or str): id(int) or name(str)
-
parse_clip_name–From a clip name in a XML or in a EDL file, it returns
-
parse_edl_file–Parse an EDL file to extract shot data.
-
publish_version–Base method for creating the logic for publishing, the return
-
read_excel–Base method for creating the logic for read and return contents of an Excel file.
-
receive_config_data_from_app–Because the user data may be passed on to the plugin on initialization,
-
return_base_task_with_kwargs–Returns a task from current plugin if using kwargs as filters.
-
return_base_task_with_path–Returns a task from current plugin if using local_path as filters.
-
return_entity_description–Return a string description of the entity (e.g., asset or shot).
-
return_file_by_ext–Return a file that matches the given extension and version pattern.
-
return_filepack_exceptions–This is a function used by the asset packager so that
-
return_last_file–Returns a tuple with the both the version and the
-
return_last_version_file–Looks at all the files with a given extension in 'path' and returns as
-
return_last_version_number–Looks at all the files in 'path' and returns as int the highest version
-
return_maya_outliner_asset_base_nodes–The plugin must send to maya all the parameters so that maya doesn't have
-
return_maya_outliner_shot_base_nodes–The plugin must send to maya all the parameters so that maya doesn't have
-
return_next_version_name–This method must be overriden according to each plugin.
-
return_seq_and_shot_from_clipname–This method is called when a EDL is parsed for an entire episode,
-
return_task_notes–Base method to create the note listing logic of a task,
-
return_task_versions–Base method to create the version listing logic of a task,
-
return_thumbnail_url–This method should be overriden according to each plugin.
-
return_version_number–Looks at the file and returns as int the version
-
server_to_local–Converts the server path to local path.
-
start_task–Hook for starting a task. To be overridden as needed.
-
stringify_class–Return a JSON-friendly representation of a value.
-
validate_last_task_path–Ensure the filesystem structure exists for the last-clicked task.
-
verify_bdl_excel–Validate the naming convention of a BDL Excel file.
Attributes:
-
app_toolbars(List[BaseToolbar]) –List[BaseToolbar]: Instantiated application toolbars.
-
apps–Supported external applications.
-
current_selected_files(List[Path]) –Currently selected file paths in the UI.
-
current_selected_tasks(List[BaseTask]) –Currently selected task objects in the UI.
-
headers(List[str]) –Column headers for displaying task data in the UI.
-
last_file_clicked(Optional[Path]) –The most recent file the user clicked.
-
last_task_clicked(Optional[BaseTask]) –The most recent task the user clicked.
-
local_root–Path: Local root directory for the project.
-
server_root–Path: Server root directory for the project.
-
tasks(List[BaseTask]) –List[BaseTask]: Tasks managed by this plugin.
-
toolbars–Registered toolbars definitions.
-
username–str: Username of the plugin user.
-
version_includes_entity(bool) –Whether the version name must include the entity (e.g., shot or asset) string.
-
version_regex(str) –Regular expression used to identify version substrings in filenames.
app_toolbars
property
app_toolbars: List[BaseToolbar]
List[BaseToolbar]: Instantiated application toolbars.
current_selected_files
property
writable
Currently selected file paths in the UI.
Returns:
-
List[Path]–List[Path]: The list of file Paths the user has selected.
current_selected_tasks
property
writable
current_selected_tasks: List[BaseTask]
Currently selected task objects in the UI.
Returns:
-
List[BaseTask]–List[BaseTask]: The list of tasks the user has selected.
headers
property
Column headers for displaying task data in the UI.
Returns:
-
List[str]–List[str]: List of header strings in display order.
last_file_clicked
property
writable
The most recent file the user clicked.
Returns:
-
Optional[Path]–Optional[Path]: Path of the last clicked file, or None.
last_task_clicked
property
writable
last_task_clicked: Optional[BaseTask]
The most recent task the user clicked.
Returns:
-
Optional[BaseTask]–Optional[BaseTask]: The last clicked task, or None if none selected.
version_includes_entity
property
writable
Whether the version name must include the entity (e.g., shot or asset) string.
Returns:
-
bool(bool) –True if entity inclusion is enforced, False otherwise.
version_regex
property
writable
Regular expression used to identify version substrings in filenames.
Returns:
-
str(str) –Current version‐matching regex pattern.
after_publish
Hook called after publishing process completes.
Parameters:
-
(*argsAny, default:()) –Positional arguments.
-
(**kwargsAny, default:{}) –Keyword arguments.
browse_note_data
This method should be overriden according to each plugin. This opens the note in the plugin's database
browse_task_data
This method should be overriden according to each plugin. This opens the task in the plugin's database
browse_version_data
This method should be overriden according to each plugin. This opens the version in the plugin's database
check_version_is_published
check_version_is_published(version: Path) -> bool
Determine whether a given version file has already been published.
Parameters:
-
(versionPath) –File path of the version to check.
Returns:
-
bool(bool) –True if published; False otherwise.
collect_data
example: compile_code = ["B1",4,5]
copy_edl_files_to_server
copy_edl_files_to_server(shot_data: dict[str, Any]) -> None
Copy EDL-associated video and audio files to the server location.
Parameters:
-
(shot_datadict[str, Any]) –Dictionary containing keys 'video_file' and 'server_path'.
create_assets_from_bdl
create_assets_from_bdl(dict_with_items: dict[str, Any], excel_file: Path) -> None
Receives an standarized dictionary that holds the data for creating assets. It yields assets that were successfully created.
Parameters:
-
(dict_with_itemsdict[str, Any]) –Structured asset data.
-
(excel_filePath) –Path to original Excel file.
create_dir_if_missing
Create a directory (and its defined subfolders) if it does not exist.
Parameters:
-
(pathPath) –The directory to ensure exists.
-
(taskBaseTask, default:None) –Task whose
task_subfoldersdefine extra subfolders to create. Defaults toself.last_task_clicked.
Returns:
-
bool(bool) –True if creation succeeded or already existed; False on error.
create_shot
create_shot(shot_data: dict[str, Any]) -> None
Create a shot using parsed shot data.
Parameters:
-
(shot_datadict[str, Any]) –Dictionary of shot attributes.
Raises:
-
NotImplementedError–Must be implemented in subclass.
create_thumbnail
classmethod
This method may be overriden and it is called when the thumbnail for a task cannot be synced because it is not in the server yet. Returns True on success
Parameters:
-
(taskBaseTask) –Task for which to create the thumbnail.
Returns:
-
bool(bool) –True if creation and resizing succeeded, False otherwise.
extract_plugin_values
Serialize plugin state and write it to a JSON file for debugging or inspection.
file_added_callback
This callback is added in case there is some further functionality to add in a per plugin level. Originally requested for a change in the DB in the Grisu plugin. File added -> task updated to IP.
file_has_convention
Check if a file meets entity and naming regex conventions.
Parameters:
-
(filePath) –File to validate.
-
(taskOptional[BaseTask], default:None) –Task context. Defaults to last clicked.
Returns:
-
bool(bool) –True if file meets convention; otherwise False.
file_has_entity
Check if the task entity is included in the file name (if required).
Parameters:
-
(filePath) –File to check.
-
(taskOptional[BaseTask], default:None) –Task context. Defaults to last clicked.
Returns:
-
bool(bool) –True if the entity name is found or not required.
filter_local_files
filter_local_files(local_path: Path, ext: str | Iterable[str] = [''], task: Optional[BaseTask] = None) -> list[Path]
Given a path, it will return the files that follow the stablished conventions
Parameters:
-
(local_pathPath) –The directory to search in.
-
(extUnion[str, Iterable[str]], default:['']) –Valid file extensions to include.
-
(taskBaseTask, default:None) –Task context to validate conventions. Defaults to last clicked task.
Returns:
-
list[Path]–list[Path]: List of files matching conventions and extensions.
generate_environment_for_app
Generate environment variables needed to launch an external application.
Parameters:
-
(taskOptional[BaseTask], default:None) –Task context to embed into environment. Defaults to None.
Returns:
-
dict[str, str]–dict[str, str]: Dictionary of environment variables.
get_plugin_info
Return a dictionary with lists of method names and variable names.
Returns:
-
dict[str, list[str]]–dict[str, list[str]]: Dictionary with 'methods' and 'variables' as keys.
get_task_filesystem
Utility function for returning the filesystem of a given task. Retrieve the local and server filesystem roots for the current task.
Parameters:
-
–*argsPositional arguments for filesystem resolution.
-
–**kwargsKeyword arguments for filesystem resolution.
Returns:
-
tuple[Path, Path]–tuple[Path, Path]: (local_path, server_path) for the task.
guess_executable_for_file
guess_executable_for_file(path: str | Path) -> Optional[str]
Guess which executable should be used to open a file based on its extension.
Parameters:
-
(pathstr | Path) –Path to the file to analyze.
Returns:
-
Optional[str]–Optional[str]: Path to the executable, or None if no match found.
load
load(cfg: dict[str, Any]) -> None
Load a Component configuration from dict.
Parameters:
-
(cfgdict[str, Any]) –dict from JSON configuration .
Returns:
-
BaseConfig(None) –Instance initialized with the loaded configuration.
on_item_doubleclicked_callback
Placeholder for handling item double-click behavior in a GUI context.
Intended to be overridden by subclasses or externally bound.
open_app_with_env
open_app_with_env(executable: Optional[str] = None, environ: Optional[str] = None) -> None
Launch an application with generated environment variables.
Parameters:
-
(executableOptional[str], default:None) –Executable path. Overridden by environ if provided.
-
(environOptional[str], default:None) –Environment variable key to retrieve executable from.
open_file_with_env
open_file_with_env(path: str | Path, executable: str) -> None
Open a file with a specified executable and plugin-defined environment.
Parameters:
-
(pathstr | Path) –File path to open.
-
(executablestr) –Path to the application executable.
open_worksheet
worksheet (int or str): id(int) or name(str)
parse_clip_name
parse_clip_name(clip_name: str) -> Any
From a clip name in a XML or in a EDL file, it returns the number of the episode, sequence and shot
Parameters:
-
(clip_namestr) –The input clip name.
Returns:
-
Any(Any) –Expected to return episode, sequence, and shot identifiers.
Raises:
-
NotImplementedError–Must be implemented in subclass.
parse_edl_file
parse_edl_file(source_edl: Path, source_video: Path) -> Iterator[dict[Any, Any]]
Parse an EDL file to extract shot data.
Parameters:
-
(source_edlPath) –Path to the EDL file.
-
(source_videoPath) –Path to the reference video.
Yields:
-
dict[Any, Any]–dict[Any, Any]: A dictionary representing each shot.
Raises:
-
NotImplementedError–Must be implemented in subclass.
publish_version
Base method for creating the logic for publishing, the return object should be a dictionary with the following structure:
Parameters:
-
(taskBaseTask) –The task being published.
-
(versionPath) –Path to the version file.
Returns:
-
dict–Dict[str, Any]: A result dict with: { "success": bool, "message": str, "error": Optional[str] }
read_excel
read_excel(excel: Path) -> tuple[list[Any], dict[Any, Any]]
Base method for creating the logic for read and return contents of an Excel file.
Parameters:
-
(excelPath) –Path to the Excel file.
Returns:
-
tuple[list[Any], dict[Any, Any]]–tuple[list[Any], dict[str, Any]]: A list of rows and a dictionary of parsed data.
receive_config_data_from_app
Because the user data may be passed on to the plugin on initialization, we have this function that will handle in a per plugin basis the logic.
Parameters:
-
(*argsAny, default:()) –Positional arguments.
-
(**kwargsAny, default:{}) –Configuration data passed by the app.
return_base_task_with_kwargs
Returns a task from current plugin if using kwargs as filters.
Parameters:
-
(**kwargsAny, default:{}) –Attribute-value pairs to match against BaseTask attributes.
Returns:
-
Optional[BaseTask]–Optional[BaseTask]: Matching task or None.
return_base_task_with_path
return_base_task_with_path(local_path: Path) -> Optional[BaseTask]
Returns a task from current plugin if using local_path as filters.
Parameters:
-
(local_pathPath) –Path to match against task local paths.
Returns:
-
Optional[BaseTask]–Optional[BaseTask]: The matching BaseTask, if any.
return_entity_description
return_entity_description(task: BaseTask, force_stop: Callable[[], bool]) -> Optional[str]
Return a string description of the entity (e.g., asset or shot).
Parameters:
-
(taskBaseTask) –The task associated with the entity.
-
(force_stopCallable[[], bool]) –Callback to interrupt processing.
Returns:
-
Optional[str]–Optional[str]: The entity description, if any.
return_file_by_ext
Return a file that matches the given extension and version pattern.
Parameters:
-
(filePath) –Input file path.
-
(extstr) –Target extension to match.
Returns:
-
Path(Path) –Matching file or fallback template path.
return_filepack_exceptions
This is a function used by the asset packager so that each plugin can define how to return an exception of files to be packed.
Returns:
-
list[str]–list[str]: A list of exception file names or patterns.
return_last_file
return_last_file(ext: Iterable[str], subdir: Path = Path(), template_failed: bool = True, task: Optional[BaseTask] = None) -> tuple[int, Path]
Returns a tuple with the both the version and the last file of a given task. Defaults to the task's localpath, but can receive a path (generaly a subpath of the local path).
Parameters:
-
(extIterable[str]) –Valid file extensions.
-
(subdirPath, default:Path()) –Subdirectory to look inside. Defaults to Path().
-
(template_failedbool, default:True) –If True and no file is found, try template. Defaults to True.
-
(taskOptional[BaseTask], default:None) –Task context. Defaults to last clicked.
Returns:
-
tuple[int, Path]–tuple[int, Path]: Tuple of version number and file path.
return_last_version_file
Looks at all the files with a given extension in 'path' and returns as Path the file that has the highest version number that matches the version_regex.
Parameters:
-
(pathPath) –Directory to search.
-
(extIterable[str]) –File extensions to match.
Returns:
-
Optional[Path]–Optional[Path]: Path to highest-versioned file, or None.
return_last_version_number
return_last_version_number(path: Path) -> int
Looks at all the files in 'path' and returns as int the highest version number that matches the version_regex.
Parameters:
-
(pathPath) –Directory to search for versioned files.
Returns:
-
int(int) –The maximum version number found. Returns 0 if none.
return_maya_outliner_asset_base_nodes
The plugin must send to maya all the parameters so that maya doesn't have to query any database to get the required values. All not-default nodes must be under one of these nodes.
Parameters:
-
(*argsAny, default:()) –Positional arguments.
-
(**kwargsAny, default:{}) –Keyword arguments, expects 'link_name' to identify asset group.
Returns:
-
Optional[list[str]]–Optional[list[str]]: List of node strings to be used as parents in Maya's outliner.
return_maya_outliner_shot_base_nodes
The plugin must send to maya all the parameters so that maya doesn't have to query any database to get the required values.
Parameters:
-
(*argsAny, default:()) –Positional arguments.
-
(**kwargsAny, default:{}) –Keyword arguments.
Returns:
-
list[str]–list[str]: Top-level node names used in Maya for organizing shots.
return_next_version_name
This method must be overriden according to each plugin. it should return a dictionary like so: { "local_path": "path there the file goes", "file_name": "name without extension", "previous_file": "copy the previous version" }
If there is no previous version, it should return a path where the templates are so that the user can choose a template form a QFileDialog. If the path is None, the QFileDialog will pop up in the root.
Parameters:
-
(extIterable[str]) –Allowed file extensions.
-
(taskBaseTask, default:None) –Task context. Defaults to last clicked.
Returns:
-
dict–Dict[str, Any]: Mapping with keys described above, or
None -
dict–if default logic is not applicable.
return_seq_and_shot_from_clipname
return_seq_and_shot_from_clipname(clip_name: str) -> Any
This method is called when a EDL is parsed for an entire episode, where the info about which sequence and shot lives in the name of the clip name, for a edl file. This method is called when self._episode_edl_workflow is True.
Parameters:
-
(clip_namestr) –The clip name from which to extract episode data.
Returns:
-
None(Any) –Override expected to return values.
return_task_notes
return_task_notes(task: BaseTask, force_stop: Callable[[], bool]) -> list[dict[str, Any]]
Base method to create the note listing logic of a task, the returned object must be a list with the following structure:
[{ "content" : str, "created_by" : str or None, "created_at" : str or None, "attachments" : list[dict["url_open":str,"url_image":str,"bytes":str,"path":str],] "url" : str }]
Parameters:
-
(taskBaseTask) –The task to retrieve notes for.
-
(force_stopCallable[[], bool]) –Callback to interrupt processing.
Returns:
-
list[dict[str, Any]]–list[dict[str, Any]]: A list of note dictionaries.
return_task_versions
Base method to create the version listing logic of a task, the returned object must be a list with the following structure:
[{ "content" : str, "created_by" : str or None, "created_at" : str or None, "attachments" : dict["url","bytes" or "url"], "url" : str "reply" : list[dict] }]
Parameters:
-
(taskBaseTask) –The task to retrieve versions for.
Returns:
-
list[dict[str, Any]]–list[dict[str, Any]]: A list of version dictionaries.
return_thumbnail_url
This method should be overriden according to each plugin. This refresh the url thumbnail in the plugin's database
Returns:
-
Optional[str]–Optional[str]: URL string if available.
return_version_number
return_version_number(file: Path) -> int
Looks at the file and returns as int the version number that matches the version_regex.
Parameters:
-
(filePath) –version file.
Returns:
-
int(int) –The maximum version number found. Returns -1 if none.
stringify_class
classmethod
stringify_class(value: Any) -> Any
Return a JSON-friendly representation of a value.
Parameters:
-
(valueAny) –Object to convert.
Returns:
-
Any–A value that can be serialized by :mod:
json.
validate_last_task_path
Ensure the filesystem structure exists for the last-clicked task.
If necessary, creates missing directories (including any
subfolders defined in task_subfolders).
Parameters:
-
(taskBaseTask, default:None) –Task to validate. Defaults to
self.last_task_clicked.
Returns:
-
Path(Path) –The validated (and possibly newly created) task path.
verify_bdl_excel
classmethod
verify_bdl_excel(excel: Path) -> tuple[bool, str]
Validate the naming convention of a BDL Excel file.
Parameters:
-
(excelPath) –The Excel file to verify.
Returns:
-
tuple[bool, str]–tuple[bool, str]: True and code string if valid; False and reason otherwise.