Skip to content

Commit c26ba7e

Browse files
committed
reformat with older version of yapf
1 parent 438d4b5 commit c26ba7e

27 files changed

+0
-66
lines changed

dbus_next/_private/marshaller.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44

55
class Marshaller:
6-
76
def __init__(self, signature, body):
87
self.signature_tree = SignatureTree._get(signature)
98
self.signature_tree.verify(body)

dbus_next/_private/util.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ def parse_annotation(annotation: str) -> str:
101101
In this case, we must eval the result which we do only when given a string
102102
constant.
103103
'''
104-
105104
def raise_value_error():
106105
raise ValueError(f'service annotations must be a string constant (got {annotation})')
107106

dbus_next/aio/message_bus.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def _future_set_result(fut, result):
2828

2929

3030
class _MessageWriter:
31-
3231
def __init__(self, bus):
3332
self.messages = Queue()
3433
self.negotiate_unix_fd = bus._negotiate_unix_fd
@@ -115,7 +114,6 @@ class MessageBus(BaseMessageBus):
115114
and receive messages.
116115
:vartype connected: bool
117116
"""
118-
119117
def __init__(self,
120118
bus_address: str = None,
121119
bus_type: BusType = BusType.SESSION,
@@ -348,7 +346,6 @@ def _make_method_handler(self, interface, method):
348346
return super()._make_method_handler(interface, method)
349347

350348
def handler(msg, send_reply):
351-
352349
def done(fut):
353350
with send_reply:
354351
result = fut.result()

dbus_next/aio/proxy_object.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ class ProxyInterface(BaseProxyInterface):
7272
If the service returns an error for a DBus call, a :class:`DBusError
7373
<dbus_next.DBusError>` will be raised with information about the error.
7474
"""
75-
7675
def _add_method(self, intr_method):
77-
7876
async def method_fn(*args, flags=MessageFlag.NONE):
7977
input_body, unix_fds = replace_fds_with_idx(intr_method.in_signature, list(args))
8078

@@ -108,7 +106,6 @@ async def method_fn(*args, flags=MessageFlag.NONE):
108106
setattr(self, method_name, method_fn)
109107

110108
def _add_property(self, intr_property):
111-
112109
async def property_getter():
113110
msg = await self.bus.call(
114111
Message(destination=self.bus_name,
@@ -154,7 +151,6 @@ class ProxyObject(BaseProxyObject):
154151
155152
For more information, see the :class:`BaseProxyObject <dbus_next.proxy_object.BaseProxyObject>`.
156153
"""
157-
158154
def __init__(self, bus_name: str, path: str, introspection: Union[intr.Node, str, ET.Element],
159155
bus: BaseMessageBus):
160156
super().__init__(bus_name, path, introspection, bus, ProxyInterface)

dbus_next/auth.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class Authenticator:
3535
3636
:seealso: https://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol
3737
"""
38-
3938
def _authentication_start(self, negotiate_unix_fd=False):
4039
raise NotImplementedError(
4140
'authentication_start() must be implemented in the inheriting class')
@@ -54,7 +53,6 @@ class AuthExternal(Authenticator):
5453
5554
:sealso: https://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol
5655
"""
57-
5856
def __init__(self):
5957
self.negotiate_unix_fd = False
6058
self.negotiating_fds = False
@@ -86,7 +84,6 @@ class AuthAnnonymous(Authenticator):
8684
8785
:sealso: https://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol
8886
"""
89-
9087
def _authentication_start(self, negotiate_unix_fd=False) -> str:
9188
if negotiate_unix_fd:
9289
raise AuthError(

dbus_next/errors.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,21 @@ class SignalDisabledError(Exception):
3131

3232

3333
class InvalidBusNameError(TypeError):
34-
3534
def __init__(self, name):
3635
super().__init__(f'invalid bus name: {name}')
3736

3837

3938
class InvalidObjectPathError(TypeError):
40-
4139
def __init__(self, path):
4240
super().__init__(f'invalid object path: {path}')
4341

4442

4543
class InvalidInterfaceNameError(TypeError):
46-
4744
def __init__(self, name):
4845
super().__init__(f'invalid interface name: {name}')
4946

5047

5148
class InvalidMemberNameError(TypeError):
52-
5349
def __init__(self, member):
5450
super().__init__(f'invalid member name: {member}')
5551

@@ -60,7 +56,6 @@ def __init__(self, member):
6056

6157

6258
class DBusError(Exception):
63-
6459
def __init__(self, type_, text, reply=None):
6560
super().__init__(text)
6661

dbus_next/glib/message_bus.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class _GLibSource:
2424

2525

2626
class _MessageSource(_GLibSource):
27-
2827
def __init__(self, bus):
2928
self.unmarshaller = None
3029
self.bus = bus
@@ -55,7 +54,6 @@ def dispatch(self, callback, user_data):
5554

5655

5756
class _MessageWritableSource(_GLibSource):
58-
5957
def __init__(self, bus):
6058
self.bus = bus
6159
self.buf = b''
@@ -101,7 +99,6 @@ def dispatch(self, callback, user_data):
10199

102100

103101
class _AuthLineSource(_GLibSource):
104-
105102
def __init__(self, stream):
106103
self.stream = stream
107104
self.buf = b''
@@ -149,7 +146,6 @@ class MessageBus(BaseMessageBus):
149146
be :class:`None` until the message bus connects.
150147
:vartype unique_name: str
151148
"""
152-
153149
def __init__(self,
154150
bus_address: str = None,
155151
bus_type: BusType = BusType.SESSION,
@@ -178,7 +174,6 @@ def connect(self, connect_notify: Callable[['MessageBus', Optional[Exception]],
178174
:class:`AuthError <dbus_next.AuthError>` on authorization errors.
179175
:type callback: :class:`Callable`
180176
"""
181-
182177
def authenticate_notify(exc):
183178
if exc is not None:
184179
if connect_notify is not None:

dbus_next/glib/proxy_object.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ def set_callback(error: Exception)
108108
:class:`DBusError <dbus_next.DBusError>` will be raised with information
109109
about the error.
110110
"""
111-
112111
def _add_method(self, intr_method):
113112
in_len = len(intr_method.in_args)
114113
out_len = len(intr_method.out_args)
@@ -177,9 +176,7 @@ def callback(body, err):
177176
setattr(self, method_name_sync, method_fn_sync)
178177

179178
def _add_property(self, intr_property):
180-
181179
def property_getter(callback):
182-
183180
def call_notify(msg, err):
184181
if err:
185182
callback(None, err)
@@ -229,7 +226,6 @@ def callback(value, err):
229226
return property_value
230227

231228
def property_setter(value, callback):
232-
233229
def call_notify(msg, err):
234230
if err:
235231
callback(None, err)
@@ -279,7 +275,6 @@ class ProxyObject(BaseProxyObject):
279275
280276
For more information, see the :class:`BaseProxyObject <dbus_next.proxy_object.BaseProxyObject>`.
281277
"""
282-
283278
def __init__(self, bus_name: str, path: str, introspection: Union[intr.Node, str, ET.Element],
284279
bus: BaseMessageBus):
285280
super().__init__(bus_name, path, introspection, bus, ProxyInterface)

dbus_next/introspection.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class Arg:
2828
- :class:`InvalidSignatureError <dbus_next.InvalidSignatureError>` - If the signature is not valid.
2929
- :class:`InvalidIntrospectionError <dbus_next.InvalidIntrospectionError>` - If the signature is not a single complete type.
3030
"""
31-
3231
def __init__(self,
3332
signature: Union[SignatureType, str],
3433
direction: List[ArgDirection] = None,
@@ -101,7 +100,6 @@ class Signal:
101100
:raises:
102101
- :class:`InvalidMemberNameError <dbus_next.InvalidMemberNameError>` - If the name of the signal is not a valid member name.
103102
"""
104-
105103
def __init__(self, name: str, args: List[Arg] = None):
106104
if name is not None:
107105
assert_member_name_valid(name)
@@ -165,7 +163,6 @@ class Method:
165163
:raises:
166164
- :class:`InvalidMemberNameError <dbus_next.InvalidMemberNameError>` - If the name of this method is not valid.
167165
"""
168-
169166
def __init__(self, name: str, in_args: List[Arg] = [], out_args: List[Arg] = []):
170167
assert_member_name_valid(name)
171168

@@ -238,7 +235,6 @@ class Property:
238235
- :class `InvalidSignatureError <dbus_next.InvalidSignatureError>` - If the given signature is not valid.
239236
- :class: `InvalidMemberNameError <dbus_next.InvalidMemberNameError>` - If the member name is not valid.
240237
"""
241-
242238
def __init__(self,
243239
name: str,
244240
signature: str,
@@ -305,7 +301,6 @@ class Interface:
305301
:raises:
306302
- :class:`InvalidInterfaceNameError <dbus_next.InvalidInterfaceNameError>` - If the name is not a valid interface name.
307303
"""
308-
309304
def __init__(self,
310305
name: str,
311306
methods: List[Method] = None,
@@ -389,7 +384,6 @@ class Node:
389384
:raises:
390385
- :class:`InvalidIntrospectionError <dbus_next.InvalidIntrospectionError>` - If the name is not a valid node name.
391386
"""
392-
393387
def __init__(self, name: str = None, interfaces: List[Interface] = None, is_root: bool = True):
394388
if not is_root and not name:
395389
raise InvalidIntrospectionError('child nodes must have a "name" attribute')

dbus_next/message.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class Message:
6161
- :class:`InvalidMemberNameError` - If ``member`` is not a valid member name.
6262
- :class:`InvalidInterfaceNameError` - If ``error_name`` or ``interface`` is not a valid interface name.
6363
"""
64-
6564
def __init__(self,
6665
destination: str = None,
6766
path: str = None,

dbus_next/message_bus.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class BaseMessageBus:
4747
and receive messages.
4848
:vartype connected: bool
4949
"""
50-
5150
def __init__(self,
5251
bus_address: Optional[str] = None,
5352
bus_type: BusType = BusType.SESSION,
@@ -628,7 +627,6 @@ def _send_reply(self, msg):
628627
bus = self
629628

630629
class SendReply:
631-
632630
def __enter__(self):
633631
return self
634632

@@ -728,7 +726,6 @@ def _process_message(self, msg):
728726
del self._method_return_handlers[msg.reply_serial]
729727

730728
def _make_method_handler(self, interface, method):
731-
732729
def handler(msg, send_reply):
733730
args = ServiceInterface._msg_body_to_args(msg)
734731
result = method.fn(interface, *args)

dbus_next/proxy_object.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class BaseProxyInterface:
3939
:ivar bus: The message bus this proxy interface is connected to.
4040
:vartype bus: :class:`BaseMessageBus <dbus_next.message_bus.BaseMessageBus>`
4141
"""
42-
4342
def __init__(self, bus_name, path, introspection, bus):
4443

4544
self.bus_name = bus_name
@@ -104,7 +103,6 @@ def _message_handler(self, msg):
104103
asyncio.create_task(cb_result)
105104

106105
def _add_signal(self, intr_signal, interface):
107-
108106
def on_signal_fn(fn):
109107
fn_signature = inspect.signature(fn)
110108
if not callable(fn) or len(fn_signature.parameters) != len(intr_signal.args):
@@ -172,7 +170,6 @@ class BaseProxyObject:
172170
- :class:`InvalidObjectPathError <dbus_next.InvalidObjectPathError>` - If the given object path is not valid.
173171
- :class:`InvalidIntrospectionError <dbus_next.InvalidIntrospectionError>` - If the introspection data for the node is not valid.
174172
"""
175-
176173
def __init__(self, bus_name: str, path: str, introspection: Union[intr.Node, str, ET.Element],
177174
bus: 'message_bus.BaseMessageBus', ProxyInterface: Type[BaseProxyInterface]):
178175
assert_object_path_valid(path)

dbus_next/service.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313

1414
class _Method:
15-
1615
def __init__(self, fn, name, disabled=False):
1716
in_signature = ''
1817
out_signature = ''
@@ -87,7 +86,6 @@ def echo_two(self, val1: 's', val2: 'u') -> 'su':
8786

8887
@no_type_check_decorator
8988
def decorator(fn):
90-
9189
@wraps(fn)
9290
def wrapped(*args, **kwargs):
9391
fn(*args, **kwargs)
@@ -101,7 +99,6 @@ def wrapped(*args, **kwargs):
10199

102100

103101
class _Signal:
104-
105102
def __init__(self, fn, name, disabled=False):
106103
inspection = inspect.signature(fn)
107104

@@ -183,7 +180,6 @@ def wrapped(self, *args, **kwargs):
183180

184181

185182
class _Property(property):
186-
187183
def set_options(self, options):
188184
self.options = getattr(self, 'options', {})
189185
for k, v in options.items():
@@ -318,7 +314,6 @@ class ServiceInterface:
318314
valid interface name.
319315
:vartype name: str
320316
"""
321-
322317
def __init__(self, name: str):
323318
# TODO cannot be overridden by a dbus member
324319
self.name = name

dbus_next/signature.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ class SignatureTree:
301301
:raises:
302302
:class:`InvalidSignatureError` if the given signature is not valid.
303303
"""
304-
305304
@staticmethod
306305
@lru_cache(maxsize=None)
307306
def _get(signature: str = '') -> "SignatureTree":
@@ -368,7 +367,6 @@ class Variant:
368367
:class:`InvalidSignatureError` if the signature is not valid.
369368
:class:`SignatureBodyMismatchError` if the signature does not match the body.
370369
"""
371-
372370
def __init__(self,
373371
signature: Union[str, SignatureTree, SignatureType],
374372
value: Any,

examples/example-service.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313

1414
class ExampleInterface(ServiceInterface):
15-
1615
def __init__(self, name):
1716
super().__init__(name)
1817
self._string_prop = 'kevin'

test/client/test_methods.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
class ExampleInterface(ServiceInterface):
13-
1413
def __init__(self):
1514
super().__init__('test.interface')
1615

test/client/test_properties.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
class ExampleInterface(ServiceInterface):
11-
1211
def __init__(self):
1312
super().__init__('test.interface')
1413
self._some_property = 'foo'

test/client/test_signals.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
class ExampleInterface(ServiceInterface):
11-
1211
def __init__(self):
1312
super().__init__('test.interface')
1413

test/service/test_decorators.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44

55
class ExampleInterface(ServiceInterface):
6-
76
def __init__(self):
87
super().__init__('test.interface')
98
self._some_prop = 55

0 commit comments

Comments
 (0)