Skip to content

Commit

Permalink
Interface generator - add support for "write" type properties
Browse files Browse the repository at this point in the history
Those properties will have the setter code generated but have
difference compared to usual "readwrite" properties. sd-bus
does not look like supporting "write" properties anyway.

Also fix trying to access the `is_read_only` attribute on unknown
property access type. Use actual `access_type` variable to raise
exception.
  • Loading branch information
igo95862 committed Aug 26, 2023
1 parent 1399e01 commit fa9e5ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sdbus/interface_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,12 @@ def __init__(self, element: Element):
self.is_explicit = False

access_type = element.attrib['access']
if access_type == 'readwrite':
if access_type == 'readwrite' or access_type == 'write':
self.is_read_only = False
elif access_type == 'read':
self.is_read_only = True
else:
raise ValueError(f"Unknown property access {self.is_read_only}")
raise ValueError(f"Unknown property access {access_type}")

super().__init__(element)

Expand Down

0 comments on commit fa9e5ef

Please sign in to comment.