daemon: LinkOptions now leverage dataclass and has type hinting, improve test_gui type hinting
This commit is contained in:
parent
18044f9474
commit
b5e53e573a
4 changed files with 27 additions and 39 deletions
|
@ -86,13 +86,8 @@ def add_link_data(
|
|||
"""
|
||||
interface_one = link_interface(link_proto.interface_one)
|
||||
interface_two = link_interface(link_proto.interface_two)
|
||||
|
||||
link_type = None
|
||||
link_type_value = link_proto.type
|
||||
if link_type_value is not None:
|
||||
link_type = LinkTypes(link_type_value)
|
||||
|
||||
options = LinkOptions(_type=link_type)
|
||||
link_type = LinkTypes(link_proto.type)
|
||||
options = LinkOptions(type=link_type)
|
||||
options_data = link_proto.options
|
||||
if options_data:
|
||||
options.delay = options_data.delay
|
||||
|
@ -106,7 +101,6 @@ def add_link_data(
|
|||
options.unidirectional = options_data.unidirectional
|
||||
options.key = options_data.key
|
||||
options.opaque = options_data.opaque
|
||||
|
||||
return interface_one, interface_two, options
|
||||
|
||||
|
||||
|
|
|
@ -772,7 +772,7 @@ class CoreHandler(socketserver.BaseRequestHandler):
|
|||
if link_type_value is not None:
|
||||
link_type = LinkTypes(link_type_value)
|
||||
|
||||
link_options = LinkOptions(_type=link_type)
|
||||
link_options = LinkOptions(type=link_type)
|
||||
link_options.delay = message.get_tlv(LinkTlvs.DELAY.value)
|
||||
link_options.bandwidth = message.get_tlv(LinkTlvs.BANDWIDTH.value)
|
||||
link_options.session = message.get_tlv(LinkTlvs.SESSION.value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue