Skip to content

Commit

Permalink
Merge pull request #426 from jack-mil/reject_port_fix#425
Browse files Browse the repository at this point in the history
fix: #425 ensure accept/reject port type is a set
  • Loading branch information
jchanvfx authored Jul 16, 2024
2 parents fd2fd4d + e0dbd9f commit 00d06ba
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions NodeGraphQt/base/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,9 +543,10 @@ def add_port_accept_connection_type(
connection_data = connection_data[key]

if accept_ptype not in connection_data:
connection_data[accept_ptype] = [accept_pname]
connection_data[accept_ptype] = set([accept_pname])
else:
connection_data[accept_ptype].append(accept_pname)
# ensure data remains a set instead of list after json de-serialize
connection_data[accept_ptype] = set(connection_data[accept_ptype]) | {accept_pname}

def port_accept_connection_types(self, node_type, port_type, port_name):
"""
Expand Down Expand Up @@ -588,9 +589,10 @@ def add_port_reject_connection_type(
connection_data = connection_data[key]

if reject_ptype not in connection_data:
connection_data[reject_ptype] = [reject_pname]
connection_data[reject_ptype] = set([reject_pname])
else:
connection_data[reject_ptype].append(reject_pname)
# ensure data remains a set instead of list after json de-serialize
connection_data[reject_ptype] = set(connection_data[reject_ptype]) | {reject_pname}

def port_reject_connection_types(self, node_type, port_type, port_name):
"""
Expand Down

0 comments on commit 00d06ba

Please sign in to comment.