Esempio n. 1
0
File: main.py Progetto: gonicus/gosa
 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")
Esempio n. 2
0
File: main.py Progetto: peuter/gosa
 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")
Esempio n. 3
0
File: main.py Progetto: peuter/gosa
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()
Esempio n. 4
0
    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)
Esempio n. 5
0
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()
Esempio n. 6
0
File: main.py Progetto: gonicus/gosa
 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__)
Esempio n. 7
0
File: main.py Progetto: gonicus/gosa
 def __init__(self):
     conn = get_system_bus()
     dbus.service.Object.__init__(self, conn, '/org/gosa/wol')
     self.env = Environment.getInstance()
Esempio n. 8
0
 def __init__(self):
     conn = get_system_bus()
     dbus.service.Object.__init__(self, conn, '/com/gonicus/gosa/notify')
     self.env = Environment.getInstance()
Esempio n. 9
0
 def __init__(self):
     conn = get_system_bus()
     dbus.service.Object.__init__(self, conn, '/org/gosa/wol')
     self.env = Environment.getInstance()
Esempio n. 10
0
 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__)