~ubuntu-core-dev/ubuntu-release-upgrader/trunk

« back to all changes in this revision

Viewing changes to DistUpgrade/DistUpgradeViewGtk3.py

  • Committer: Iain Lane
  • Date: 2014-11-10 13:31:51 UTC
  • mto: This revision was merged to the branch mainline in revision 2842.
  • Revision ID: iain.lane@canonical.com-20141110133151-s3iqc241rdd1ert9
Port to VTE 2.91, and update dependency in debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
import gi
23
23
gi.require_version("Gtk", "3.0")
24
 
gi.require_version("Vte", "2.90")
 
24
gi.require_version("Vte", "2.91")
25
25
 
26
26
from gi.repository import Gtk
27
27
from gi.repository import Gdk
266
266
            self.term.feed_child("n\n", -1)
267
267
 
268
268
    def fork(self):
269
 
        pty = Vte.Pty.new(Vte.PtyFlags.DEFAULT)
 
269
        pty = Vte.Pty.new_sync(Vte.PtyFlags.DEFAULT)
270
270
        pid = os.fork()
271
271
        if pid == 0:
272
272
            # WORKAROUND for broken feisty vte where envv does not work)
279
279
            # duplication detection
280
280
            os.environ["DPKG_UNTRANSLATED_MESSAGES"] = "1"
281
281
        else:
282
 
            self.term.set_pty_object(pty)
 
282
            self.term.set_pty(pty)
283
283
            self.term.watch_child(pid)
284
284
        return pid
285
285
 
316
316
                self.parent._webkit_view.get_property("load-status") == 2):
317
317
                self.parent._webkit_view.execute_script('progress("%s")' % percent)
318
318
 
319
 
    def child_exited(self, term):
 
319
    def child_exited(self, term, status):
320
320
        # we need to capture the full status here (not only the WEXITSTATUS)
321
 
        self.apt_status =  term.get_child_exit_status()
 
321
        self.apt_status =  status
322
322
        self.finished = True
323
323
 
324
324
    def wait_child(self):
362
362
        if hidden==False:
363
363
            self.parent.expander_terminal.set_expanded(True)
364
364
        self.finished = False
365
 
        (success, pid) = self.term.fork_command_full(Vte.PtyFlags.DEFAULT,
366
 
                                                     "/",
367
 
                                                     cmd,
368
 
                                                     None,
369
 
                                                     0,    # GLib.SpawnFlags
370
 
                                                     None, # child_setup
371
 
                                                     None, # child_setup_data
372
 
                                                     )
 
365
        (success, pid) = self.term.spawn_sync(Vte.PtyFlags.DEFAULT,
 
366
                                              "/",
 
367
                                              cmd,
 
368
                                              None,
 
369
                                              0,    # GLib.SpawnFlags
 
370
                                              None, # child_setup
 
371
                                              None, # child_setup_data
 
372
                                              None, # GCancellable
 
373
                                              )
373
374
        if not success or pid < 0:
374
375
            # error
375
376
            return
519
520
 
520
521
    def create_terminal(self):
521
522
        " helper to create a vte terminal "
522
 
        self._term = Vte.Terminal()
 
523
        self._term = Vte.Terminal.new()
523
524
        self._term.connect("key-press-event", self._key_press_handler)
524
 
        self._term.set_font_from_string("monospace 10")
 
525
        fontdesc = Pango.font_description_from_string("monospace 10")
 
526
        self._term.set_font(fontdesc)
525
527
        self._terminal_lines = []
526
528
        self.hbox_custom.pack_start(self._term, True, True, 0)
527
529
        self._term.realize()