~paelzer/gdebi/gdebi-fix-glib-2.68

« back to all changes in this revision

Viewing changes to GDebi/GDebiGtk.py

  • Committer: Michael Vogt
  • Date: 2014-11-24 13:50:25 UTC
  • mfrom: (485.1.1 gdebi)
  • Revision ID: michael.vogt@ubuntu.com-20141124135025-c9cf67s7588m9kxr
mergedĀ lp:~laney/gdebi/vte2.91

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
import gi
42
42
gi.require_version("Gtk", "3.0")
43
 
gi.require_version("Vte", "2.90")
 
43
gi.require_version("Vte", "2.91")
44
44
from gi.repository import Gtk
45
45
from gi.repository import GObject
46
46
from gi.repository import GLib
866
866
            self.term_expander.set_expanded(False)
867
867
            self.install = install
868
868
        def commit(self):
869
 
            def finish_dpkg(term, lock):
 
869
            def finish_dpkg(term, status, lock):
870
870
                """ helper that is run when dpkg finishes """
871
 
                status = term.get_child_exit_status()
872
871
                self.exitstatus = posix.WEXITSTATUS(status)
873
872
                #print "dpkg finished %s %s" % (pid,status)
874
873
                #print "exit status: %s" % self.exitstatus
922
921
 
923
922
            # prepare for the fork
924
923
            self.term.connect("child-exited", finish_dpkg, lock)
925
 
            (res, pid) =self.term.fork_command_full(
 
924
            (res, pid) =self.term.spawn_sync(
926
925
                Vte.PtyFlags.DEFAULT,
927
926
                "/",
928
927
                argv,
931
930
                # FIXME: add setup_func that closes all fds excpet for writefd
932
931
                None, #setup_func
933
932
                None, #setup_data
 
933
                None, #cancellable
934
934
                )
935
935
            #print "fork_command_full: ", res, pid
936
936
 
1015
1015
            # sleep just long enough to not create a busy loop
1016
1016
            time.sleep(0.01)
1017
1017
        def fork(self):
1018
 
            pty = Vte.Pty.new(Vte.PtyFlags.DEFAULT)
 
1018
            pty = Vte.Pty.new_sync(Vte.PtyFlags.DEFAULT)
1019
1019
            pid = os.fork()
1020
1020
            if pid == 0:
1021
1021
                # *grumpf* workaround bug in vte here (gnome bug #588871)
1026
1026
                pty.child_setup()
1027
1027
                # FIXME: close all fds expect for self.writefd
1028
1028
            else:
1029
 
                self.term.set_pty_object(pty)
 
1029
                self.term.set_pty(pty)
1030
1030
                self.term.watch_child(pid)
1031
1031
            return pid
1032
1032
        def wait_child(self):