Skip to content

Commit

Permalink
Adjust connection.
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-ynput committed Nov 11, 2024
1 parent 7017611 commit 4d5c2c7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions client/ayon_flame/plugins/create/create_workfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,26 @@ def _get_project_metadata_handle(self):
"""
wiretap_client = WireTapClient()
wiretap_client.init()
server = WireTapServerHandle("localhost:IFFFS")

current_project = flapi.get_current_project()
project_node_handle = WireTapNodeHandle(server, f"/projects/{current_project.name}")
return wiretap_client, project_node_handle
return wiretap_client, server, project_node_handle

def _get_project_metadata(self):
""" Returns the metadata stored at current project.
Returns:
xml.etree.ElementTree. The project metadata data.
"""
client, handle = self._get_project_metadata_handle()
client, server, handle = self._get_project_metadata_handle()
metadata = WireTapStr()
handle.getMetaData("XML", "", 1, metadata)

handle.disconnect()
del client
del handle
del server

return ET.fromstring(metadata.c_str())

Expand All @@ -74,13 +76,14 @@ def _dump_instance_data(self, data):
nickname_entry.text = json.dumps(data)
updated = ET.tostring(metadata, encoding='unicode')

project_node_handle = self._get_project_metadata_handle()
client, server, handle = self._get_project_metadata_handle()
new_metadata = WireTapStr(updated)
ok = project_node_handle.setMetaData("XML", new_metadata.c_str())
ok = handle.setMetaData("XML", new_metadata.c_str())

handle.disconnect()
del client
del handle
del server

return ok

Expand Down

0 comments on commit 4d5c2c7

Please sign in to comment.