Skip to content

Commit

Permalink
Clean up unused code: DbusManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef-Friedrich committed Mar 3, 2024
1 parent b274621 commit 6ea533d
Showing 1 changed file with 0 additions and 48 deletions.
48 changes: 0 additions & 48 deletions check_systemd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,54 +1029,6 @@ def __init__(self) -> None:
"""


# Data source: D-Bus ##########################################################


class DbusManager:
"""
This class holds the main entry point object of the D-Bus systemd API. See
the section `The Manager Object
<https://www.freedesktop.org/software/systemd/man/org.freedesktop.systemd1.html#The%20Manager%20Object>`_
in the systemd D-Bus API.
"""

__manager: DBusProxy

def __init__(self) -> None:
self.__manager = DbusManager.__proxy().new_for_bus_sync(
DbusManager.__bus_type().SYSTEM,
DbusManager.__flags().NONE,
None,
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
"org.freedesktop.systemd1.Manager",
None,
)

@staticmethod
def __proxy() -> type[DBusProxy]:
"""List all units."""
if DBusProxy:
return DBusProxy
raise Exception("The package PyGObject (gi) is not available.")

@staticmethod
def __bus_type() -> type[BusType]:
if BusType:
return BusType
raise Exception("The package PyGObject (gi) is not available.")

@staticmethod
def __flags() -> type[DBusProxyFlags]:
if DBusProxyFlags:
return DBusProxyFlags
raise Exception("The package PyGObject (gi) is not available.")

@property
def manager(self) -> DBusProxy:
return self.__manager


# Unit abstraction ############################################################


Expand Down

0 comments on commit 6ea533d

Please sign in to comment.