Skip to content

Commit 4bcf72a

Browse files
author
Tony Crisci
committed
dont use future annotations
1 parent 19b1eda commit 4bcf72a

File tree

12 files changed

+15
-40
lines changed

12 files changed

+15
-40
lines changed

dbus_next/aio/message_bus.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from ..message_bus import BaseMessageBus
42
from .._private.unmarshaller import Unmarshaller
53
from ..message import Message
@@ -41,7 +39,7 @@ def __init__(self, bus_address: str = None, bus_type: BusType = BusType.SESSION)
4139
self._loop = asyncio.get_event_loop()
4240
self._unmarshaller = Unmarshaller(self._stream)
4341

44-
async def connect(self) -> MessageBus:
42+
async def connect(self) -> 'MessageBus':
4543
"""Connect this message bus to the DBus daemon.
4644
4745
This method must be called before the message bus can be used.

dbus_next/aio/proxy_object.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from ..proxy_object import BaseProxyObject, BaseProxyInterface
42
from ..message_bus import BaseMessageBus
53
from ..message import Message
@@ -138,5 +136,5 @@ def __init__(self, bus_name: str, path: str, introspection: Union[intr.Node, str
138136
def get_interface(self, name: str) -> ProxyInterface:
139137
return super().get_interface(name)
140138

141-
def get_children(self) -> List[ProxyObject]:
139+
def get_children(self) -> List['ProxyObject']:
142140
return super().get_children()

dbus_next/errors.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from __future__ import annotations
2-
3-
41
class SignatureBodyMismatchError(ValueError):
52
pass
63

dbus_next/glib/message_bus.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from .._private.unmarshaller import Unmarshaller
42
from ..constants import BusType
53
from ..message import Message
@@ -150,7 +148,7 @@ def __init__(self, bus_address: str = None, bus_type: BusType = BusType.SESSION)
150148
super().__init__(bus_address, bus_type, ProxyObject)
151149
self._main_context = GLib.main_context_default()
152150

153-
def connect(self, connect_notify: Callable[[MessageBus, Optional[Exception]], None] = None):
151+
def connect(self, connect_notify: Callable[['MessageBus', Optional[Exception]], None] = None):
154152
"""Connect this message bus to the DBus daemon.
155153
156154
This method or the synchronous version must be called before the
@@ -225,7 +223,7 @@ def on_match_added(reply, err):
225223

226224
self._auth_readline(on_authline)
227225

228-
def connect_sync(self) -> MessageBus:
226+
def connect_sync(self) -> 'MessageBus':
229227
"""Connect this message bus to the DBus daemon.
230228
231229
This method or the asynchronous version must be called before the

dbus_next/glib/proxy_object.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from ..proxy_object import BaseProxyObject, BaseProxyInterface
42
from ..message_bus import BaseMessageBus
53
from ..message import Message
@@ -280,5 +278,5 @@ def __init__(self, bus_name: str, path: str, introspection: Union[intr.Node, str
280278
def get_interface(self, name: str) -> ProxyInterface:
281279
return super().get_interface(name)
282280

283-
def get_children(self) -> List[ProxyObject]:
281+
def get_children(self) -> List['ProxyObject']:
284282
return super().get_children()

dbus_next/introspection.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from .constants import PropertyAccess, ArgDirection
42
from .signature import SignatureTree, SignatureType
53
from .validators import assert_member_name_valid, assert_interface_name_valid
@@ -54,7 +52,7 @@ def __init__(self,
5452
self.name = name
5553
self.direction = direction
5654

57-
def from_xml(element: ET.Element, direction: ArgDirection) -> Arg:
55+
def from_xml(element: ET.Element, direction: ArgDirection) -> 'Arg':
5856
"""Convert a :class:`xml.etree.ElementTree.Element` into a
5957
:class:`Arg`.
6058
@@ -177,7 +175,7 @@ def __init__(self, name: str, in_args: List[Arg] = [], out_args: List[Arg] = [])
177175
self.in_signature = ''.join(arg.signature for arg in in_args)
178176
self.out_signature = ''.join(arg.signature for arg in out_args)
179177

180-
def from_xml(element: ET.Element) -> Method:
178+
def from_xml(element: ET.Element) -> 'Method':
181179
"""Convert an :class:`xml.etree.ElementTree.Element` to a :class:`Method`.
182180
183181
The element must be valid DBus introspection XML for a ``method``.
@@ -319,7 +317,7 @@ def __init__(self,
319317
self.properties = properties if properties is not None else []
320318

321319
@staticmethod
322-
def from_xml(element: ET.Element) -> Interface:
320+
def from_xml(element: ET.Element) -> 'Interface':
323321
"""Convert a :class:`xml.etree.ElementTree.Element` into a
324322
:class:`Interface`.
325323
@@ -424,7 +422,7 @@ def from_xml(element: ET.Element, is_root: bool = False):
424422
return node
425423

426424
@staticmethod
427-
def parse(data: str) -> Node:
425+
def parse(data: str) -> 'Node':
428426
"""Parse XML data as a string into a :class:`Node`.
429427
430428
The string must be valid DBus introspection XML.
@@ -482,7 +480,7 @@ def indent(elem, level=0):
482480
return header + ET.tostring(xml, encoding='unicode').rstrip()
483481

484482
@staticmethod
485-
def default(name: str = None) -> Node:
483+
def default(name: str = None) -> 'Node':
486484
"""Create a :class:`Node` with the default interfaces supported by this library.
487485
488486
The default interfaces include:

dbus_next/message.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from ._private.marshaller import Marshaller
42
from .constants import MessageType, MessageFlag, ErrorType
53
from ._private.constants import PROTOCOL_VERSION, HeaderField, LITTLE_ENDIAN
@@ -115,7 +113,7 @@ def require_fields(*fields):
115113
raise InvalidMessageError(f'got unknown message type: {self.message_type}')
116114

117115
@staticmethod
118-
def new_error(msg: Message, error_name: str, error_text: str) -> Message:
116+
def new_error(msg: 'Message', error_name: str, error_text: str) -> 'Message':
119117
"""A convenience constructor to create an error message in reply to the given message.
120118
121119
:param msg: The message this error is in reply to.
@@ -138,7 +136,7 @@ def new_error(msg: Message, error_name: str, error_text: str) -> Message:
138136
body=[error_text])
139137

140138
@staticmethod
141-
def new_method_return(msg: Message, signature: str = '', body: List[Any] = []) -> Message:
139+
def new_method_return(msg: 'Message', signature: str = '', body: List[Any] = []) -> 'Message':
142140
"""A convenience constructor to create a method return to the given method call message.
143141
144142
:param msg: The method call message this is a reply to.
@@ -165,7 +163,7 @@ def new_signal(path: str,
165163
interface: str,
166164
member: str,
167165
signature: str = '',
168-
body: List[Any] = None) -> Message:
166+
body: List[Any] = None) -> 'Message':
169167
"""A convenience constructor to create a new signal message.
170168
171169
:param path: The path of this signal.

dbus_next/message_bus.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from ._private.address import get_bus_address, parse_address
42
from .message import Message
53
from .constants import BusType, MessageFlag, MessageType, ErrorType, NameFlag, RequestNameReply, ReleaseNameReply

dbus_next/proxy_object.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from .validators import assert_object_path_valid, assert_bus_name_valid
42
from . import message_bus
53
from .message import Message
@@ -108,7 +106,7 @@ class BaseProxyObject:
108106
"""
109107

110108
def __init__(self, bus_name: str, path: str, introspection: Union[intr.Node, str, ET.Element],
111-
bus: message_bus.BaseMessageBus, ProxyInterface: Type[BaseProxyInterface]):
109+
bus: 'message_bus.BaseMessageBus', ProxyInterface: Type[BaseProxyInterface]):
112110
assert_object_path_valid(path)
113111
assert_bus_name_valid(bus_name)
114112

@@ -222,7 +220,7 @@ def message_handler(msg):
222220
self._interfaces[name] = interface
223221
return interface
224222

225-
def get_children(self) -> List[BaseProxyObject]:
223+
def get_children(self) -> List['BaseProxyObject']:
226224
"""Get the child nodes of this proxy object according to the introspection data."""
227225
if self._children is None:
228226
self._children = [

dbus_next/service.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from .constants import PropertyAccess
42
from .signature import SignatureTree, SignatureBodyMismatchError, Variant
53
from . import introspection as intr

0 commit comments

Comments
 (0)