-
Notifications
You must be signed in to change notification settings - Fork 51
Workfiles: Add basic workfiles api #1275
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
Open
iLLiCiTiT
wants to merge
120
commits into
develop
Choose a base branch
from
enhancement/enhance-workfile-api
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,964
−1,540
Open
Changes from all commits
Commits
Show all changes
120 commits
Select commit
Hold shift + click to select a range
3bfb11d
moved interfaces to subfolder
iLLiCiTiT 28eaf12
move exception into separate file
iLLiCiTiT 9d0d830
move workfiles interface to separate file
iLLiCiTiT 9e1e36c
remove ABC form 'IWorkfileHost'
iLLiCiTiT 7e5d861
remove validation of methods
iLLiCiTiT 9140d11
added helper data structure for colleting workfiles
iLLiCiTiT 156eb14
remove unnecessary 'work_root'
iLLiCiTiT fe28391
add new line char at the end
iLLiCiTiT 515cd79
first implementation of list workfiles
iLLiCiTiT 152211a
'get_workfile_extensions' is not abstract anymore
iLLiCiTiT d78e25c
added helper function to collect comments from existing workfiles
iLLiCiTiT 615529f
added 'WorkfileInfo' to host public api
iLLiCiTiT a61a94d
added more helper functions to workfile path mapping
iLLiCiTiT b5f8997
selection cares about more information
iLLiCiTiT 1037776
pass project settings to template key getter
iLLiCiTiT 4220f92
pass host name to template data getter
iLLiCiTiT 67f478d
modified controller base
iLLiCiTiT ea12998
use only IWorkfileHost methods
iLLiCiTiT f5c8f01
pass host to workfiles model
iLLiCiTiT 326a182
updated 'set_selected_workfile_path'
iLLiCiTiT ad7b2c4
more methods requiring 'IWorkfileHost'
iLLiCiTiT ec579ca
updated controller arguments to match needs
iLLiCiTiT 16b29a6
added reset to workfile model
iLLiCiTiT 085f4cb
added more cache items
iLLiCiTiT 1211a71
move private methods below public ones
iLLiCiTiT a2dad64
move public methods above private
iLLiCiTiT 0f64ab1
remove unused method
iLLiCiTiT 5fe625a
remove more unnecessary methods
iLLiCiTiT f4961bc
updated workarea model
iLLiCiTiT 98acfd8
updated entities model
iLLiCiTiT 60c2c4e
move public method above private
iLLiCiTiT e4f6342
implement 'get_workfile_entities' on controller
iLLiCiTiT b8b012d
updated UI to work with new methods and structures
iLLiCiTiT e705358
fix abstract property
iLLiCiTiT 95b1820
added some typehints into IWorkfileHost
iLLiCiTiT bef56a5
added todos into controller
iLLiCiTiT 552bc03
added comment
iLLiCiTiT 80397a3
implemented base of published workfile collection
iLLiCiTiT dde5c6a
use collect published files from host
iLLiCiTiT b76ae8f
update controller
iLLiCiTiT 1b7474b
Merge workfile entities model into workfiles model
iLLiCiTiT 2f6ed06
Remove publish workfiles model
iLLiCiTiT eb33281
merge workfile models into one
iLLiCiTiT 6a7f41f
move workfiles related logic to workfiles model
iLLiCiTiT 21c1a8b
added base implementation to workfiles interface
iLLiCiTiT 29d824d
modified change current context function
iLLiCiTiT f4638b9
implemented utils functions for workfiles
iLLiCiTiT 6390879
modified workfiles tool accordingly
iLLiCiTiT 723463d
use correct function
iLLiCiTiT a37c074
expect entities instead of ids
iLLiCiTiT 36aae5a
Merge branch 'develop' into enhancement/enhance-workfile-api
iLLiCiTiT 70f3c05
linting fixes
iLLiCiTiT a159e02
fix arguments
iLLiCiTiT 3d2d786
Merge branch 'develop' into enhancement/enhance-workfile-api
iLLiCiTiT edb371f
Remove outdated todo
iLLiCiTiT 88647ee
Merge branch 'develop' into enhancement/enhance-workfile-api
MustafaJafar e97f7f1
added docstring to dataclasses
iLLiCiTiT c83bae2
move context change responsibility to host
iLLiCiTiT a879d11
get_ayon_username is using cached values
iLLiCiTiT 8bda7dd
move all the responsibility about workfiles to IWorkfileHost
iLLiCiTiT c52f300
use host methods to work with workfiles and add helper functions
iLLiCiTiT e08c5f2
modified workfiles model to use api functions
iLLiCiTiT c5cd53b
Merge branch 'develop' into enhancement/enhance-workfile-api
iLLiCiTiT 406f43a
formatting cleanup
iLLiCiTiT 7cb22fb
add arrow to dependencies
iLLiCiTiT df55a32
fix 'PublishedWorkfileInfo'
iLLiCiTiT f4545a6
some formatting changes
iLLiCiTiT e6bb395
set AYON_WORKDIR when workfile is opened
iLLiCiTiT 524ed03
removed unnecessary workdir handling from set current context
iLLiCiTiT 63b69a9
added 'TemplateResult' typint
iLLiCiTiT 0f79217
remove unused imports
iLLiCiTiT 87832f1
modified change context function
iLLiCiTiT 77dbf29
added typehints and modify docstrings
iLLiCiTiT 6391116
add deprecation warning for 'full_path' argument
iLLiCiTiT c8a7e35
iterate over extensions fix
iLLiCiTiT f130f54
add missing import
iLLiCiTiT 79922d9
update docstrings
iLLiCiTiT dd637bb
use comprehention
iLLiCiTiT 808712e
Apply suggestions from code review
iLLiCiTiT 5baf13c
fix formatting
iLLiCiTiT 509543e
better description of workfile_entities
iLLiCiTiT 3701564
Merge branch 'develop' into enhancement/enhance-workfile-api
iLLiCiTiT 26145b3
Merge branch 'develop' into enhancement/enhance-workfile-api
iLLiCiTiT e53962d
let 'version' argument optional
iLLiCiTiT d97829a
filter published workfiles by extension
iLLiCiTiT 26a35a8
pre-fetch project entity
iLLiCiTiT d3699c3
modified docstrings
iLLiCiTiT 76ceefb
require kwargs for 'list_workfiles'
iLLiCiTiT 3e6aafa
apply suggestion
iLLiCiTiT 351ab7d
use 'open_workfile' to open workfile
iLLiCiTiT 762f986
use dataclasses to pass information form method to method
iLLiCiTiT 688e5f2
remove unnecessary line
iLLiCiTiT da1a39e
validate extension earlier
iLLiCiTiT 411c433
added typehints
iLLiCiTiT 0c25def
added more docstrings
iLLiCiTiT 397bfd2
added deprecation warnings
iLLiCiTiT 7eb067a
remove safe type hint
iLLiCiTiT a23678b
use 'ContextChangeData' for '_set_current_context'
iLLiCiTiT 873db37
don't use safe typehint
iLLiCiTiT 0bf1e9a
add indentation
iLLiCiTiT e3114d8
Apply suggestions from code review
iLLiCiTiT 2e798f9
Apply suggestions from code review
iLLiCiTiT 34d9289
remove invalid returns typehints
iLLiCiTiT 09858f6
added typeddict for context data
iLLiCiTiT 7666586
use kwargs
iLLiCiTiT 0ae72c8
small enhancmement of docstring
iLLiCiTiT 48bc7a0
small clarity enhancement
iLLiCiTiT 8b35eb3
fix kwargs
iLLiCiTiT 3e5e873
added helper function to save current file with current context
iLLiCiTiT 060fea4
Merge branch 'develop' into enhancement/enhance-workfile-api
iLLiCiTiT ab363bf
remove typehint
iLLiCiTiT 1e7c9db
define context change reason enum
iLLiCiTiT 1d40243
fix typehint
iLLiCiTiT 646f3be
wrap optional arguments into wrappers
iLLiCiTiT 91377aa
formatting fixes
iLLiCiTiT 3e2c6f7
Merge branch 'develop' into enhancement/enhance-workfile-api
iLLiCiTiT dc476de
fix missing argument
iLLiCiTiT b142bc4
expect folder path and task name in 'save_current_workfile_to'
iLLiCiTiT bc9a1b6
remove unused import
iLLiCiTiT a29ebd0
Merge branch 'develop' into enhancement/enhance-workfile-api
iLLiCiTiT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from enum import Enum | ||
|
||
|
||
class StrEnum(str, Enum): | ||
"""A string-based Enum class that allows for string comparison.""" | ||
|
||
def __str__(self) -> str: | ||
return self.value | ||
|
||
|
||
class ContextChangeReason(StrEnum): | ||
"""Reasons for context change in the host.""" | ||
undefined = "undefined" | ||
workfile_open = "workfile.opened" | ||
workfile_save = "workfile.saved" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
from .exceptions import MissingMethodsError | ||
from .workfiles import ( | ||
IWorkfileHost, | ||
WorkfileInfo, | ||
PublishedWorkfileInfo, | ||
|
||
OpenWorkfileOptionalData, | ||
ListWorkfilesOptionalData, | ||
ListPublishedWorkfilesOptionalData, | ||
SaveWorkfileOptionalData, | ||
CopyWorkfileOptionalData, | ||
CopyPublishedWorkfileOptionalData, | ||
|
||
get_open_workfile_context, | ||
get_list_workfiles_context, | ||
get_list_published_workfiles_context, | ||
get_save_workfile_context, | ||
get_copy_workfile_context, | ||
get_copy_repre_workfile_context, | ||
|
||
OpenWorkfileContext, | ||
ListWorkfilesContext, | ||
ListPublishedWorkfilesContext, | ||
SaveWorkfileContext, | ||
CopyWorkfileContext, | ||
CopyPublishedWorkfileContext, | ||
) | ||
from .interfaces import ( | ||
IPublishHost, | ||
INewPublisher, | ||
ILoadHost, | ||
) | ||
|
||
|
||
__all__ = ( | ||
"MissingMethodsError", | ||
|
||
"IWorkfileHost", | ||
"WorkfileInfo", | ||
"PublishedWorkfileInfo", | ||
|
||
"OpenWorkfileOptionalData", | ||
"ListWorkfilesOptionalData", | ||
"ListPublishedWorkfilesOptionalData", | ||
"SaveWorkfileOptionalData", | ||
"CopyWorkfileOptionalData", | ||
"CopyPublishedWorkfileOptionalData", | ||
|
||
"get_open_workfile_context", | ||
"get_list_workfiles_context", | ||
"get_list_published_workfiles_context", | ||
"get_save_workfile_context", | ||
"get_copy_workfile_context", | ||
"get_copy_repre_workfile_context", | ||
|
||
"OpenWorkfileContext", | ||
"ListWorkfilesContext", | ||
"ListPublishedWorkfilesContext", | ||
"SaveWorkfileContext", | ||
"CopyWorkfileContext", | ||
"CopyPublishedWorkfileContext", | ||
|
||
"IPublishHost", | ||
"INewPublisher", | ||
"ILoadHost", | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class MissingMethodsError(ValueError): | ||
"""Exception when host miss some required methods for a specific workflow. | ||
|
||
Args: | ||
host (HostBase): Host implementation where are missing methods. | ||
missing_methods (list[str]): List of missing methods. | ||
""" | ||
|
||
def __init__(self, host, missing_methods): | ||
joined_missing = ", ".join( | ||
['"{}"'.format(item) for item in missing_methods] | ||
) | ||
super().__init__( | ||
f"Host \"{host.name}\" miss methods {joined_missing}" | ||
) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.