Skip to content

Commit

Permalink
Split sdbus.dbus_proxy_async in to multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
igo95862 committed Jun 11, 2022
1 parent bc12b29 commit 4ab2d55
Show file tree
Hide file tree
Showing 10 changed files with 1,164 additions and 971 deletions.
24 changes: 17 additions & 7 deletions src/sdbus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,19 @@
DbusUnknownObjectError,
DbusUnknownPropertyError,
)
from .dbus_proxy_async import (
from .dbus_proxy_async_interfaces import (
DbusInterfaceCommonAsync,
DbusObjectManagerInterfaceAsync,
)
from .dbus_proxy_async_method import (
dbus_method_async,
dbus_method_async_override,
)
from .dbus_proxy_async_property import (
dbus_property_async,
dbus_property_async_override,
dbus_signal_async,
)
from .dbus_proxy_async_signal import dbus_signal_async
from .dbus_proxy_sync import (
DbusInterfaceCommon,
DbusObjectManagerInterface,
Expand Down Expand Up @@ -96,7 +100,7 @@
sd_bus_open_user_machine,
)

__all__ = [
__all__ = (
'get_default_bus', 'request_default_bus_name',
'request_default_bus_name_async', 'set_default_bus',

Expand All @@ -121,10 +125,16 @@
'DbusUnknownMethodError', 'DbusUnknownObjectError',
'DbusUnknownPropertyError',

'DbusInterfaceCommonAsync',
'DbusObjectManagerInterfaceAsync',
'DbusInterfaceCommonAsync', 'dbus_method_async',
'dbus_method_async_override', 'dbus_property_async',
'dbus_property_async_override', 'dbus_signal_async',

'dbus_method_async',
'dbus_method_async_override',

'dbus_property_async',
'dbus_property_async_override',

'dbus_signal_async',

'DbusInterfaceCommon',
'DbusObjectManagerInterface',
Expand Down Expand Up @@ -152,4 +162,4 @@
'sd_bus_open_system_remote',
'sd_bus_open_user',
'sd_bus_open_user_machine',
]
)
10 changes: 4 additions & 6 deletions src/sdbus/autodoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@
from sphinx.application import Sphinx
from sphinx.ext.autodoc import AttributeDocumenter, MethodDocumenter

from .dbus_proxy_async import (
DbusInterfaceCommonAsync,
DbusMethodAsync,
DbusPropertyAsync,
DbusSignalAsync,
)
from .dbus_proxy_async_interfaces import DbusInterfaceCommonAsync
from .dbus_proxy_async_method import DbusMethodAsync
from .dbus_proxy_async_property import DbusPropertyAsync
from .dbus_proxy_async_signal import DbusSignalAsync


class DbusMethodDocumenter(MethodDocumenter):
Expand Down
27 changes: 26 additions & 1 deletion src/sdbus/dbus_common_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@

from inspect import getfullargspec
from types import FunctionType
from typing import Any, Dict, List, Optional, Sequence, Tuple
from typing import (
Any,
Callable,
Dict,
List,
Optional,
Sequence,
Tuple,
TypeVar,
)

from .dbus_common_funcs import (
_is_property_flags_correct,
Expand Down Expand Up @@ -250,3 +259,19 @@ def __init__(self,

self.__doc__ = original_method.__doc__
self.__annotations__ = original_method.__annotations__


class DbusBindedAsync:
...


T = TypeVar('T')


class DbusOverload:
def __init__(self, original: T):
self.original = original
self.setter_overload: Optional[Callable[[Any, T], None]] = None

def setter(self, new_setter: Optional[Callable[[Any, T], None]]) -> None:
self.setter_overload = new_setter

0 comments on commit 4ab2d55

Please sign in to comment.