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

def ubuntuone::devtools::services::dbus::DBusRunner::start_service (   self,
  tempdir = None 
Start our own session bus daemon for testing.

Definition at line 74 of file dbus.py.

        """Start our own session bus daemon for testing."""
        if not tempdir:
            tempdir = os.path.join(os.getcwd(), '_trial_temp')
        dbus = find_executable("dbus-daemon")
        if not dbus:
            raise NotFoundError("dbus-daemon was not found.")


        dbus_args = ["--fork",
                     "--config-file=" + self.config_file,
        sp = subprocess.Popen([dbus] + dbus_args,
                              bufsize=4096, stdout=subprocess.PIPE,

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

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

Generated by  Doxygen 1.6.0   Back to index