Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a find_work_files hook for perforce work flows #73

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jhultgre
Copy link

Add a hook to allow finding additional workfiles.
This is handy in a perforce setup where all the workfiles might not have been synced to the users machine when it runs the _find_workfiles method.

environment.work_template,
publish_items = self._process_publish_files(sg_publishes,
environment.publish_template,
environment.work_template,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line under-indented for visual indent

environment.publish_template,
environment.work_template,
publish_items = self._process_publish_files(sg_publishes,
environment.publish_template,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line under-indented for visual indent

environment.valid_file_extensions)
return {"sg_publishes":filtered_publishes}
return {"sg_publishes":filtered_publishes}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ':'

@@ -371,7 +371,7 @@ def _process_publish_files(self, sg_publishes, publish_template, work_template,
# add new file item for this publish. Note that we also keep track of the
# work path even though we don't know if this publish has a corresponding
# work file.
files[(file_key, file_details["version"])] = {"key":file_key,
files[(file_key, file_details["version"])] = {"key":file_key,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ':'

publish_template,
work_template,
context,
name_map,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line under-indented for visual indent

work_template,
context,
name_map,
version_compare_ignore_fields,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line under-indented for visual indent

work_file_item_details = self._process_work_files(filtered_work_files,
work_template,
context,
name_map,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line under-indented for visual indent

version_compare_ignore_fields,
work_file_item_details = self._process_work_files(filtered_work_files,
work_template,
context,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line under-indented for visual indent

name_map,
version_compare_ignore_fields,
work_file_item_details = self._process_work_files(filtered_work_files,
work_template,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line under-indented for visual indent

and pre_v_str[-1] in delims_str

if (pre_v_str and post_v_str
and pre_v_str[-1] in delims_str

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line break before binary operator

HookClass = sgtk.get_hook_baseclass()


class FilterWorkFiles(HookClass):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class should be named FindWorkFiles.


class FilterWorkFiles(HookClass):
"""
Hook that can be used to filter the list of work files found by the app for the current
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description should be updated.

aren't synced on the users machine yet.
"""

def execute(self, work_files_paths, work_template, work_fields, skip_fields, skip_missing_optional_keys=True, **kwargs):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black would make changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants