|
1 | | -from __future__ import annotations |
2 | | - |
3 | 1 | from .constants import PropertyAccess, ArgDirection |
4 | 2 | from .signature import SignatureTree, SignatureType |
5 | 3 | from .validators import assert_member_name_valid, assert_interface_name_valid |
@@ -54,7 +52,7 @@ def __init__(self, |
54 | 52 | self.name = name |
55 | 53 | self.direction = direction |
56 | 54 |
|
57 | | - def from_xml(element: ET.Element, direction: ArgDirection) -> Arg: |
| 55 | + def from_xml(element: ET.Element, direction: ArgDirection) -> 'Arg': |
58 | 56 | """Convert a :class:`xml.etree.ElementTree.Element` into a |
59 | 57 | :class:`Arg`. |
60 | 58 |
|
@@ -177,7 +175,7 @@ def __init__(self, name: str, in_args: List[Arg] = [], out_args: List[Arg] = []) |
177 | 175 | self.in_signature = ''.join(arg.signature for arg in in_args) |
178 | 176 | self.out_signature = ''.join(arg.signature for arg in out_args) |
179 | 177 |
|
180 | | - def from_xml(element: ET.Element) -> Method: |
| 178 | + def from_xml(element: ET.Element) -> 'Method': |
181 | 179 | """Convert an :class:`xml.etree.ElementTree.Element` to a :class:`Method`. |
182 | 180 |
|
183 | 181 | The element must be valid DBus introspection XML for a ``method``. |
@@ -319,7 +317,7 @@ def __init__(self, |
319 | 317 | self.properties = properties if properties is not None else [] |
320 | 318 |
|
321 | 319 | @staticmethod |
322 | | - def from_xml(element: ET.Element) -> Interface: |
| 320 | + def from_xml(element: ET.Element) -> 'Interface': |
323 | 321 | """Convert a :class:`xml.etree.ElementTree.Element` into a |
324 | 322 | :class:`Interface`. |
325 | 323 |
|
@@ -424,7 +422,7 @@ def from_xml(element: ET.Element, is_root: bool = False): |
424 | 422 | return node |
425 | 423 |
|
426 | 424 | @staticmethod |
427 | | - def parse(data: str) -> Node: |
| 425 | + def parse(data: str) -> 'Node': |
428 | 426 | """Parse XML data as a string into a :class:`Node`. |
429 | 427 |
|
430 | 428 | The string must be valid DBus introspection XML. |
@@ -482,7 +480,7 @@ def indent(elem, level=0): |
482 | 480 | return header + ET.tostring(xml, encoding='unicode').rstrip() |
483 | 481 |
|
484 | 482 | @staticmethod |
485 | | - def default(name: str = None) -> Node: |
| 483 | + def default(name: str = None) -> 'Node': |
486 | 484 | """Create a :class:`Node` with the default interfaces supported by this library. |
487 | 485 |
|
488 | 486 | The default interfaces include: |
|
0 commit comments