Skip to content

feat: Backlog/generic publisher #543

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
wants to merge 113 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
8c42aaa
remove framework-widget
lluisCM Feb 7, 2024
d6233a9
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 7, 2024
d4f8153
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 7, 2024
5a9acf3
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 7, 2024
2a04cd7
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 8, 2024
6fc405f
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 8, 2024
90ab95e
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 8, 2024
3849d82
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 8, 2024
599b789
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 12, 2024
3f25798
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 12, 2024
95a0677
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 12, 2024
19f54de
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 12, 2024
398bd41
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 12, 2024
f760b3e
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 12, 2024
f4b9e97
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 12, 2024
b1d7554
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 12, 2024
e132d07
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 12, 2024
5477ad1
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 13, 2024
4b1a74f
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 14, 2024
b84d398
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 16, 2024
cbd2c2c
update date on publisher widget and timetracker widget
lluisCM Feb 16, 2024
1f48ab1
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 16, 2024
e3132db
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 20, 2024
bc67e17
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 21, 2024
391cde7
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 23, 2024
8e19633
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 26, 2024
acbfd19
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 26, 2024
1a6ea94
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 26, 2024
6a86252
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Feb 27, 2024
1122fea
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 8, 2024
08ba490
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 8, 2024
4a7e8e1
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 8, 2024
88ec7a4
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 8, 2024
b06af7f
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 8, 2024
fc7a97a
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 11, 2024
51910e9
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 11, 2024
8b89581
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 11, 2024
d585549
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 12, 2024
64f2fae
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 13, 2024
cab8fc8
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 14, 2024
31af13f
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 14, 2024
3e3b94c
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 14, 2024
cc5bc48
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 15, 2024
ce76c12
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 15, 2024
4971d86
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 15, 2024
e43a837
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 15, 2024
7880e5a
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 20, 2024
f2126cd
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 21, 2024
2ea0840
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 22, 2024
800cf67
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 25, 2024
2ccdea9
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 25, 2024
161a28f
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 25, 2024
3b45d10
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 25, 2024
1c6dc9e
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 25, 2024
d86b8eb
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 25, 2024
716cefd
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 25, 2024
dad7f7f
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 26, 2024
a193ae6
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 26, 2024
b11e6fc
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 26, 2024
53c6978
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 27, 2024
0da980d
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 27, 2024
9fcf879
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Mar 27, 2024
9d1c194
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Apr 2, 2024
828ec82
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Apr 2, 2024
9ba34ac
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Apr 2, 2024
8fdca98
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Apr 15, 2024
bcd4524
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Apr 15, 2024
aedffe6
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Apr 17, 2024
629803e
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Apr 18, 2024
9f7edb7
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Apr 19, 2024
1c0abd9
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Apr 19, 2024
7913ca8
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Apr 22, 2024
f1cd994
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Apr 22, 2024
c4694bd
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM Apr 24, 2024
0111334
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM May 2, 2024
f12b4a0
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM May 2, 2024
a98cf5d
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM May 2, 2024
d6b48aa
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM May 2, 2024
a693cad
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM May 3, 2024
2d5365d
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM May 3, 2024
f551eb7
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM May 7, 2024
e19fabe
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM May 7, 2024
dd0bc2e
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM May 8, 2024
22eaa3c
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM May 13, 2024
9e7fdf3
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM May 13, 2024
96fc21a
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM May 13, 2024
3779b60
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM May 14, 2024
f8a85c4
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM May 14, 2024
fb5d9a6
Merge branch 'main' of github.com:ftrackhq/integrations
lluisCM May 15, 2024
8810d6f
WIP ui renaming working
lluisCM May 15, 2024
1beae72
Merge branch 'main' of github.com:ftrackhq/integrations into backlog/…
lluisCM Jun 26, 2024
36257ad
WIP
lluisCM Jun 27, 2024
dcc343f
WIP rename component name working
lluisCM Jun 27, 2024
8282e03
WIP
lluisCM Jun 28, 2024
7f26284
WIP
lluisCM Jun 28, 2024
e145597
WIP sync with Host
lluisCM Jul 2, 2024
04cebdb
WIP
lluisCM Jul 2, 2024
7a899b8
make sure unic names is working
lluisCM Jul 3, 2024
74fc4e1
WIP add remove and save preset working, Publish not working
lluisCM Jul 3, 2024
952af17
WIP on publishing
lluisCM Jul 3, 2024
14568ac
cleanup and add release notes
lluisCM Jul 4, 2024
449fa98
rename multi to generic
lluisCM Jul 8, 2024
6f4ea54
Changed add buttons
lluisCM Jul 8, 2024
c1f7642
Publisher working with sequences and temporal directories
lluisCM Jul 9, 2024
e7c9305
Fix bug when disabling plugin, wasn't working and now its working
lluisCM Jul 9, 2024
4b4e56f
Maya generic publisher
lluisCM Jul 10, 2024
5108a22
remove maya changes
lluisCM Jul 11, 2024
d976431
Merge branch 'main' of github.com:ftrackhq/integrations into backlog/…
lluisCM Jul 11, 2024
a184454
Merge branch 'main' of github.com:ftrackhq/integrations into backlog/…
lluisCM Jul 11, 2024
3351849
remove connect changes
lluisCM Jul 11, 2024
fc7b1ab
align with main
lluisCM Jul 11, 2024
62854ef
add no tool-config fix and changes with main
lluisCM Jul 12, 2024
50f20c5
align with main
lluisCM Sep 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libs/constants/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ftrack Constants library release Notes

## Upcoming

* [new] Add HOST_SYNC_TOOL_CONFIG_TOPIC constant.

## v3.0.0
2024-09-19

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
# Client wants to verify the plugins are registered in host
HOST_VERIFY_PLUGINS_TOPIC = '{}.host.verify.plugins'.format(_BASE_)

# Client wants to verify the plugins are registered in host
HOST_SYNC_TOOL_CONFIG_TOPIC = '{}.host.sync.tool_config'.format(_BASE_)

# Remote integration<>Python communication; Connection and alive check
DISCOVER_REMOTE_INTEGRATION_TOPIC = "{}.discover.remote.integration".format(
_BASE_
Expand Down
7 changes: 7 additions & 0 deletions libs/framework-core/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# ftrack Framework Core library release Notes

## upcoming

* [change] Registry; support get tool config extensions by reference.
* [new] Client; Add method save_tool_config_in_destination; Save given tool config as yaml file in specific destination.
* [new] Client, Host, Event Manager; Add host_sync_tool_config on event manager to sync tool config from the client to the host.


## v3.0.0
2024-09-19

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging
import uuid
from collections import defaultdict
import yaml

from six import string_types

Expand Down Expand Up @@ -545,6 +546,22 @@ def set_config_options(
item_reference
] = options

def sync_tool_config(self, tool_config):
'''
Sync the given *tool_config* with the host.
'''
self.event_manager.publish.host_sync_tool_config(
self.host_id,
tool_config,
)

def save_tool_config_in_destination(self, tool_config, destination):
'''
Save the given *tool_config* in the given *destination*.
'''
with open(destination, 'w') as file:
yaml.dump(tool_config, file)

def run_ui_hook(
self, tool_config_reference, plugin_config_reference, payload
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,25 @@ def host_verify_plugins(self, host_id, plugin_names, callback=None):
event_topic = constants.event.HOST_VERIFY_PLUGINS_TOPIC
return self._publish_event(event_topic, data, callback)

def host_sync_tool_config(
self,
host_id,
tool_config,
callback=None,
mode=constants.event.LOCAL_EVENT_MODE,
):
'''
Publish an event with topic
:const:`~ftrack_framework_core.constants.event.HOST_VERIFY_PLUGINS_TOPIC`
'''
data = {
'host_id': host_id,
'tool_config': tool_config,
}

event_topic = constants.event.HOST_SYNC_TOOL_CONFIG_TOPIC
return self._publish_event(event_topic, data, callback, mode)


class Subscribe(object):
'''Class with all the events subscribed by the framework'''
Expand Down Expand Up @@ -453,3 +472,13 @@ def host_verify_plugins(self, host_id, callback=None):
constants.event.HOST_VERIFY_PLUGINS_TOPIC, host_id
)
return self._subscribe_event(event_topic, callback)

def host_sync_tool_config(self, host_id, callback=None):
'''
Subscribe to an event with topic
:const:`~ftrack_framework_core.constants.event.HOST_SYNC_TOOL_CONFIG_TOPIC`
'''
event_topic = '{} and data.host_id={}'.format(
constants.event.HOST_SYNC_TOOL_CONFIG_TOPIC, host_id
)
return self._subscribe_event(event_topic, callback)
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ def _subscribe_events(self):
self.id, self._verify_plugins_callback
)

# Subscribe to sync tool config from the client
self.event_manager.subscribe.host_sync_tool_config(
self.id, self._sync_tool_config_callback
)

@delegate_to_main_thread_wrapper
def _client_context_change_callback(self, event):
'''Callback when the client has changed context'''
Expand Down Expand Up @@ -310,6 +315,7 @@ def run_ui_hook_callback(self, event):
client_options = event['data']['client_options']
payload = event['data']['payload']

# TODO: we should be able to replace this to: tool_config = self.registry.get_one(extension_type='tool_config', reference=tool_config_reference)
for typed_configs in self.tool_configs.values():
tool_config = None
for _tool_config in typed_configs:
Expand Down Expand Up @@ -398,3 +404,32 @@ def verify_plugins(self, plugin_names):
f'correct extensions path: {unregistered_plugins}'
)
return unregistered_plugins

def _sync_tool_config_callback(self, event):
'''
Runs the data with the defined engine type of the given *event*

Returns result of the engine run.

*event* : Published from the client host connection at
:meth:`~ftrack_framework_core.client.HostConnection.run`
'''

tool_config = event['data']['tool_config']

registered_tool_config = self.registry.get_one(
extension_type='tool_config', reference=tool_config['reference']
)

if not registered_tool_config:
self.registry.add(
tool_config['type'],
name=tool_config['name'],
extension=tool_config,
path="Memory",
create_reference=False,
)
else:
registered_tool_config = tool_config

return registered_tool_config
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,15 @@ def scan_extensions(self, paths, extension_types=None):
for extension in unique_extensions:
self.add(**extension)

def add(self, extension_type, name, extension, path):
def add(
self, extension_type, name, extension, path, create_reference=True
):
'''
Add the given *extension_type* with *name*, *extension* and *path to
the registry
'''
if extension_type == 'tool_config':
self.augment_tool_config(extension)
if extension_type == 'tool_config' and create_reference:
self.create_unic_references(extension, skip_root=False)
# We use extension_type and not type to not interfere with python
# build in type
self.__registry[extension_type].append(
Expand All @@ -141,12 +143,12 @@ def add(self, extension_type, name, extension, path):
}
)

def _get(self, extensions, name, extension, path):
def _get(self, extensions, name, extension, path, reference=None):
'''
Check given *extensions* list to match given *name*, *extension* and *path* if
neither provided, return all available extensions
'''
if not any([name, extension, path]):
if not any([name, extension, path, reference]):
return extensions
found_extensions = []
for _extension in extensions:
Expand All @@ -156,10 +158,21 @@ def _get(self, extensions, name, extension, path):
continue
if path and _extension['path'] != path:
continue
if reference and isinstance(_extension['extension'], dict):
if _extension['extension'].get('type') == 'tool_config':
if _extension['extension'].get('reference') != reference:
continue
found_extensions.append(_extension)
return found_extensions

def get(self, name=None, extension=None, path=None, extension_type=None):
def get(
self,
name=None,
extension=None,
path=None,
extension_type=None,
reference=None,
):
'''
Return given matching *name*, *extension*, *path* or *extension_type*.
If nothing provided, return all available extensions.
Expand All @@ -168,13 +181,25 @@ def get(self, name=None, extension=None, path=None, extension_type=None):
if extension_type:
extensions = self.registry.get(extension_type)
found_extensions.extend(
self._get(extensions, name, extension, path)
self._get(
extensions=extensions,
name=name,
extension=extension,
path=path,
reference=reference,
)
)
else:
for extension_type in list(self.registry.keys()):
extensions = self.registry.get(extension_type)
found_extensions.extend(
self._get(extensions, name, extension, path)
self._get(
extensions=extensions,
name=name,
extension=extension,
path=path,
reference=reference,
)
)

return found_extensions
Expand All @@ -186,30 +211,37 @@ def get_one(self, *args, **kwargs):
'''
matching_extensions = self.get(*args, **kwargs)
if len(matching_extensions) == 0:
kwargs_string = ''.join([('%s=%s' % x) for x in kwargs.items()])
raise Exception(
kwargs_string = ', '.join([('%s=%s' % x) for x in kwargs.items()])
self.logger.warning(
"Extension not found. Arguments: {}".format(
(''.join(args), kwargs_string)
)
)
return None

if len(matching_extensions) > 1:
kwargs_string = ''.join([('%s=%s' % x) for x in kwargs.items()])
raise Exception(
kwargs_string = ', '.join([('%s=%s' % x) for x in kwargs.items()])
self.logger.warning(
"Multiple matching extensions found.Arguments: {}".format(
(''.join(args), kwargs_string)
)
)
return None
return matching_extensions[0]

def augment_tool_config(self, tool_config):
def create_unic_references(self, tool_config, skip_root=False):
'''
Augment the given *tool_config* to add a reference id to it
and each plugin and group
'''
tool_config['reference'] = uuid.uuid4().hex
if not skip_root:
tool_config['reference'] = uuid.uuid4().hex
if 'engine' in tool_config:
self._recursive_create_reference(tool_config['engine'])
else:
# if doesn't contain engine, we assume that is a portion of the tool
# config so we augment that portion
self._recursive_create_reference([tool_config])
return tool_config

def _recursive_create_reference(self, tool_config_engine_portion):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,12 @@ def run_tool_config(self, tool_config_reference):
arguments = {"tool_config_reference": tool_config_reference}
self.client_method_connection('run_tool_config', arguments=arguments)

def sync_tool_config(self, tool_config):
args = {
'tool_config': tool_config,
}
self.client_method_connection('sync_tool_config', arguments=args)

def _on_client_notify_ui_log_item_added_callback(self, event):
'''
Client notify dialog that a new log item has been added.
Expand Down
4 changes: 4 additions & 0 deletions libs/qt-style/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ftrack Framework QT Style library release Notes

## upcoming

* [changed] LineEdit; Support label property.

## v3.0.0
2024-09-19

Expand Down
9 changes: 9 additions & 0 deletions libs/qt/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# ftrack QT library release Notes


## upcoming

* [new] MenuButton; Button supporting menu if multiple action items provided.
* [changed] Improved AccordionWidget and AcordionHeaderWidget to use EditableLabelWidget and possibility to add a remove button. Emits bin_clicked, title_changed, title_edited signals.
* [changed] StatusMaterialIconWidget clickable.
* [new] Editable label widget.


## v3.0.0
2024-09-19

Expand Down
Loading
Loading