mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
added prediscovery to few actions
This commit is contained in:
parent
7873548657
commit
c6bf0f6e3c
5 changed files with 5 additions and 10 deletions
|
|
@ -130,12 +130,11 @@ class CustomAttributes(BaseAction):
|
||||||
'dynamic enumerator', 'number'
|
'dynamic enumerator', 'number'
|
||||||
]
|
]
|
||||||
|
|
||||||
def discover(self, session, entities, event):
|
def prediscover(self, event):
|
||||||
'''
|
'''
|
||||||
Validation
|
Validation
|
||||||
- action is only for Administrators
|
- action is only for Administrators
|
||||||
'''
|
'''
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def launch(self, session, entities, event):
|
def launch(self, session, entities, event):
|
||||||
|
|
|
||||||
|
|
@ -26,13 +26,9 @@ class CreateFolders(BaseAction):
|
||||||
'698620-icon-105-folder-add-512.png'
|
'698620-icon-105-folder-add-512.png'
|
||||||
)
|
)
|
||||||
|
|
||||||
def discover(self, session, entities, event):
|
def prediscover(self, event):
|
||||||
''' Validation '''
|
''' Validation '''
|
||||||
|
|
||||||
# if (len(entities) == 0 or entities[0].entity_type not in
|
|
||||||
# ['Episode', 'Sequence', 'Shot', 'Folder', 'Asset Build']):
|
|
||||||
# return False
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def getShotAsset(self, entity):
|
def getShotAsset(self, entity):
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ class DeleteAsset(BaseAction):
|
||||||
|
|
||||||
value = None
|
value = None
|
||||||
|
|
||||||
def discover(self, session, entities, event):
|
def prediscover(self, event):
|
||||||
''' Validation '''
|
''' Validation '''
|
||||||
selection = event["data"].get("selection", None)
|
selection = event["data"].get("selection", None)
|
||||||
if selection is None or len(selection) > 1:
|
if selection is None or len(selection) > 1:
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ class AssetsRemover(BaseAction):
|
||||||
#: Db
|
#: Db
|
||||||
db = DbConnector()
|
db = DbConnector()
|
||||||
|
|
||||||
def discover(self, session, entities, event):
|
def prediscover(self, event):
|
||||||
''' Validation '''
|
''' Validation '''
|
||||||
selection = event["data"].get("selection", None)
|
selection = event["data"].get("selection", None)
|
||||||
if selection is None or len(selection) != 1:
|
if selection is None or len(selection) != 1:
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ class JobKiller(BaseAction):
|
||||||
#: Action description.
|
#: Action description.
|
||||||
description = 'Killing all running jobs younger than day'
|
description = 'Killing all running jobs younger than day'
|
||||||
|
|
||||||
def discover(self, session, entities, event):
|
def prediscover(self, event):
|
||||||
''' Validation '''
|
''' Validation '''
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue