mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
more io usage replaced, added ignore_me variable to actions/events for ftrack server, added 'get avalon projects' function, fixed few bugs, added titles to show_interface in action handlers
This commit is contained in:
parent
ae68a41400
commit
9d50a5b8b7
10 changed files with 153 additions and 93 deletions
|
|
@ -158,7 +158,6 @@ class Sync_To_Avalon(BaseAction):
|
|||
)
|
||||
|
||||
if 'errors' in result and len(result['errors']) > 0:
|
||||
print('error')
|
||||
items = []
|
||||
for error in result['errors']:
|
||||
for key, message in error.items():
|
||||
|
|
@ -173,10 +172,12 @@ class Sync_To_Avalon(BaseAction):
|
|||
self.log.error(
|
||||
'{}: {}'.format(key, message)
|
||||
)
|
||||
title = 'Hey You! Few Errors were raised! (*look below*)'
|
||||
|
||||
job['status'] = 'failed'
|
||||
session.commit()
|
||||
self.show_interface(event, items)
|
||||
|
||||
self.show_interface(event, items, title)
|
||||
return {
|
||||
'success': False,
|
||||
'message': "Sync to avalon FAILED"
|
||||
|
|
|
|||
|
|
@ -86,7 +86,6 @@ class Sync_to_Avalon(BaseEvent):
|
|||
custom_attributes=custom_attributes
|
||||
)
|
||||
if 'errors' in result and len(result['errors']) > 0:
|
||||
print('error')
|
||||
items = []
|
||||
for error in result['errors']:
|
||||
for key, message in error.items():
|
||||
|
|
@ -101,9 +100,9 @@ class Sync_to_Avalon(BaseEvent):
|
|||
self.log.error(
|
||||
'{}: {}'.format(key, message)
|
||||
)
|
||||
|
||||
session.commit()
|
||||
self.show_interface(event, items)
|
||||
title = 'Hey You! You raised few Errors! (*look below*)'
|
||||
self.show_interface(event, items, title)
|
||||
return
|
||||
|
||||
if avalon_project is None:
|
||||
|
|
@ -122,7 +121,8 @@ class Sync_to_Avalon(BaseEvent):
|
|||
'name': 'error',
|
||||
'value': ftrack_message
|
||||
}]
|
||||
self.show_interface(event, items)
|
||||
title = 'Hey You! Unknown Error has been raised! (*look below*)'
|
||||
self.show_interface(event, items, title)
|
||||
self.log.error(message)
|
||||
|
||||
return
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ class BaseEvent(object):
|
|||
on_error='ignore'
|
||||
)
|
||||
|
||||
def show_interface(self, event, items):
|
||||
def show_interface(self, event, items, title=''):
|
||||
"""
|
||||
Shows interface to user who triggered event
|
||||
- 'items' must be list containing Ftrack interface items
|
||||
|
|
@ -153,7 +153,8 @@ class BaseEvent(object):
|
|||
topic='ftrack.action.trigger-user-interface',
|
||||
data=dict(
|
||||
type='widget',
|
||||
items=items
|
||||
items=items,
|
||||
title=title
|
||||
),
|
||||
target=target
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue