コード例 #1
0
ファイル: main.py プロジェクト: 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")
コード例 #2
0
ファイル: main.py プロジェクト: 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")
コード例 #3
0
ファイル: main.py プロジェクト: 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()
コード例 #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)
コード例 #5
0
ファイル: main.py プロジェクト: lhm-limux/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)
        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()
コード例 #6
0
ファイル: main.py プロジェクト: 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__)
コード例 #7
0
ファイル: main.py プロジェクト: gonicus/gosa
 def __init__(self):
     conn = get_system_bus()
     dbus.service.Object.__init__(self, conn, '/org/gosa/wol')
     self.env = Environment.getInstance()
コード例 #8
0
ファイル: main.py プロジェクト: lhm-limux/gosa
 def __init__(self):
     conn = get_system_bus()
     dbus.service.Object.__init__(self, conn, '/com/gonicus/gosa/notify')
     self.env = Environment.getInstance()
コード例 #9
0
 def __init__(self):
     conn = get_system_bus()
     dbus.service.Object.__init__(self, conn, '/org/gosa/wol')
     self.env = Environment.getInstance()
コード例 #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__)