def __init__(self): conn = get_system_bus() dbus.service.Object.__init__(self, conn, '/org/gosa/service') self.env = Environment.getInstance() self.log = logging.getLogger(__name__) self.systembus = dbus.SystemBus() systemd_obj = self.systembus.get_object("org.freedesktop.systemd1", "/org/freedesktop/systemd1") self.systemd = dbus.Interface(systemd_obj, "org.freedesktop.systemd1.Manager")
def mainLoop(env): global loop log = logging.getLogger(__name__) try: # connect to dbus and setup loop dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) get_system_bus() # Instanciate dbus objects PluginRegistry(component='gosa.dbus.module') # Enter main loop loop = GLib.MainLoop() loop.run() except Exception as detail: log.critical("unexpected error in mainLoop") log.exception(detail) log.debug(traceback.format_exc()) finally: shutdown()
def __init__(self): self.scripts = {} # Connect to D-Bus service conn = get_system_bus() self.conn = conn dbus.service.Object.__init__(self, conn, '/org/gosa/shell') # Initialize paths and logging self.log = logging.getLogger(__name__) self.env = Environment.getInstance() self.script_path = self.env.config.get( "dbus.script-path", "/etc/gosa/shell.d").strip("'\"") # Start notifier for file changes in /etc/gosa/shell.d try: ShellDNotifier(self.script_path, self.__notifier_callback) # Initially load all signatures self.__notifier_callback() except Exception: self.log.error("failed to start monitoring of '%s'" % self.script_path)
def mainLoop(env): global loop log = logging.getLogger(__name__) try: # connect to dbus and setup loop dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) system_bus = get_system_bus() # Instanciate dbus objects pr = PluginRegistry(component='gosa_dbus.modules') # Enter main loop loop = gobject.MainLoop() loop.run() except Exception as detail: log.critical("unexpected error in mainLoop") log.exception(detail) log.debug(traceback.format_exc()) finally: shutdown()
def __init__(self): conn = get_system_bus() dbus.service.Object.__init__(self, conn, '/org/gosa/cups') self.env = Environment.getInstance() self.log = logging.getLogger(__name__)
def __init__(self): conn = get_system_bus() dbus.service.Object.__init__(self, conn, '/org/gosa/wol') self.env = Environment.getInstance()
def __init__(self): conn = get_system_bus() dbus.service.Object.__init__(self, conn, '/com/gonicus/gosa/notify') self.env = Environment.getInstance()
def __init__(self): conn = get_system_bus() dbus.service.Object.__init__(self, conn, '/org/gosa/environment') self.env = Environment.getInstance() self.log = logging.getLogger(__name__)