Logo Search packages:      
Sourcecode: ubuntuone-dev-tools version File versions  Download package

def ubuntuone::devtools::dbus_util::DBusRunner::startDBus (   self  ) 

Start our own session bus daemon for testing.

Definition at line 58 of file dbus_util.py.

00058                        :
        """Start our own session bus daemon for testing."""
        dbus = find_executable("dbus-daemon")
        if not dbus:
            raise NotFoundError("dbus-daemon was not found.")

        config_file = self._find_config_file()

        dbus_args = ["--fork",
                     "--config-file=" + config_file,
                     "--print-address=1",
                     "--print-pid=2"]
        p = subprocess.Popen([dbus] + dbus_args,
                             bufsize=4096, stdout=subprocess.PIPE,
                             stderr=subprocess.PIPE)

        self.dbus_address = "".join(p.stdout.readlines()).strip()
        self.dbus_pid = int("".join(p.stderr.readlines()).strip())

        if self.dbus_address != "":
            os.environ["DBUS_SESSION_BUS_ADDRESS"] = self.dbus_address
        else:
            os.kill(self.dbus_pid, signal.SIGKILL)
            raise DBusLaunchError("There was a problem launching dbus-daemon.")
        self.running = True

    def stopDBus(self):


Generated by  Doxygen 1.6.0   Back to index