def open_fd(self, fd, password=None): self.spice_session = spice.Session() if password: self.spice_session.set_property("password", password) gobject.GObject.connect(self.spice_session, "channel-new", self._channel_new_cb) self.spice_session.open_fd(fd)
def _attempt_connection(self, _backoff): self._disconnect_viewer() self._session = SpiceClientGtk.Session() self._session.set_property('password', self._password) self._session.set_property('enable-usbredir', False) # Ensure clipboard sharing is disabled self._gtk_session = SpiceClientGtk.spice_gtk_session_get(self._session) self._gtk_session.set_property('auto-clipboard', False) GObject.connect(self._session, 'channel-new', self._new_channel) self._session.open_fd(-1)
def open_host(self, ginfo, password=None): host, port = ginfo.get_conn_host() uri = "spice://" uri += str(host) + "?port=" + str(port) logging.debug("spice uri: %s", uri) self.spice_session = spice.Session() self.spice_session.set_property("uri", uri) if password: self.spice_session.set_property("password", password) gobject.GObject.connect(self.spice_session, "channel-new", self._channel_new_cb) self.spice_session.connect()
def _connect_viewer(self, password): self._disconnect_viewer() self._session = SpiceClientGtk.Session() self._session.set_property('password', password) self._session.set_property('enable-usbredir', False) # Ensure clipboard sharing is disabled self._gtk_session = SpiceClientGtk.spice_gtk_session_get(self._session) self._gtk_session.set_property('auto-clipboard', False) try: # Enable audio self._audio = SpiceClientGtk.Audio(self._session) except RuntimeError: # No local PulseAudio, etc. pass self._session.connect_object('channel-new', self._new_channel, self._session) self._session.open_fd(-1)
def settings(self): self.session = _spice.Session() uri = "spice://" uri += str(self.host) + "?port=" + str(self.port) self.session.set_property("uri", uri)