Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ target-version = "py312"
line-length = 88

[tool.ruff.lint]
select = ["PL"]
select = ["B", "F", "PL"]

[tool.ruff.lint.isort]
known-first-party = ["into-dbus-python"]
Expand Down
28 changes: 13 additions & 15 deletions src/dbus_python_client_gen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@
Top-level classes and methods.
"""

from ._errors import (
DPClientError,
DPClientGenerationError,
DPClientGetPropertyContext,
DPClientInvalidArgError,
DPClientInvocationContext,
DPClientInvocationError,
DPClientKeywordError,
DPClientMarshallingError,
DPClientMethodCallContext,
DPClientRuntimeError,
DPClientSetPropertyContext,
)
from ._invokers import make_class
from ._version import __version__
from ._errors import DPClientError as DPClientError
from ._errors import DPClientGenerationError as DPClientGenerationError
from ._errors import DPClientGetPropertyContext as DPClientGetPropertyContext
from ._errors import DPClientInvalidArgError as DPClientInvalidArgError
from ._errors import DPClientInvocationContext as DPClientInvocationContext
from ._errors import DPClientInvocationError as DPClientInvocationError
from ._errors import DPClientKeywordError as DPClientKeywordError
from ._errors import DPClientMarshallingError as DPClientMarshallingError
from ._errors import DPClientMethodCallContext as DPClientMethodCallContext
from ._errors import DPClientRuntimeError as DPClientRuntimeError
from ._errors import DPClientSetPropertyContext as DPClientSetPropertyContext
from ._invokers import make_class as make_class
from ._version import __version__ as __version__
4 changes: 1 addition & 3 deletions src/dbus_python_client_gen/_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
Exception hierarchy for this package.
"""

from abc import ABC


class DPClientInvocationContext(ABC):
class DPClientInvocationContext:
"""
Identifies the context in which an invocation error occurred.

Expand Down
10 changes: 5 additions & 5 deletions tests/test_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _test_property(self, klass, prop):
self.assertTrue(hasattr(prop_klass, "Get"))

with self.assertRaises(AttributeError):
getattr(prop_klass, "Get")(None)
prop_klass.Get(None)

if "write" in access:
self.assertTrue(hasattr(prop_klass, "Set"))
Expand All @@ -63,14 +63,14 @@ def _test_property(self, klass, prop):
pass
else:
with self.assertRaises(DPClientMarshallingError):
getattr(prop_klass, "Set")(None, None)
prop_klass.Set(None, None)

if "readwrite" in access:
self.assertTrue(hasattr(prop_klass, "Get"))
self.assertTrue(hasattr(prop_klass, "Set"))

with self.assertRaises(AttributeError):
getattr(prop_klass, "Get")(None)
prop_klass.Get(None)

def _test_method(self, klass, method):
"""
Expand All @@ -95,8 +95,8 @@ def _test_klasses(self):
self.assertTrue(hasattr(klass, "Properties"))
self.assertTrue(hasattr(klass, "Methods"))

properties = getattr(klass, "Properties")
methods = getattr(klass, "Methods")
properties = klass.Properties
methods = klass.Methods

for method in spec.findall("./method"):
self._test_method(methods, method)
Expand Down
Loading