~ubuntu-branches/ubuntu/karmic/zeroinstall-injector/karmic

« back to all changes in this revision

Viewing changes to zeroinstall/0launch-gui/compile.py

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Leonard
  • Date: 2009-04-05 10:40:06 UTC
  • mfrom: (1.1.9 upstream) (6.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20090405104006-e3x93j5ibvjqu65a
Tags: 0.39-1ubuntu1
* Updated build for Python 2.6.
* FFe: LP: #336317.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, Thomas Leonard
 
1
# Copyright (C) 2009, Thomas Leonard
2
2
# See the README file for details, or visit http://0install.net.
3
3
 
4
 
import os, popen2
 
4
import os, subprocess
5
5
import gobject
6
6
import dialog
7
7
from logging import info
19
19
        def run(self, command, success):
20
20
                assert self.child is None
21
21
                self.success = success
22
 
                self.child = popen2.Popen4(command)
23
 
                self.child.tochild.close()
24
 
                gobject.io_add_watch(self.child.fromchild, gobject.IO_IN | gobject.IO_HUP, self.got_data)
 
22
                self.child = subprocess.Popen(command,
 
23
                                                stdout = subprocess.PIPE,
 
24
                                                stderr = subprocess.STDOUT)
 
25
                gobject.io_add_watch(self.child.stdout, gobject.IO_IN | gobject.IO_HUP, self.got_data)
25
26
        
26
27
        def got_data(self, src, cond):
27
28
                data = os.read(src.fileno(), 100)
72
73
                # Do the whole build-and-register-feed
73
74
                c = Command()
74
75
                c.run(("0launch",
 
76
                        '--message', 'Download the 0compile tool, to compile the source code',
75
77
                        '--not-before=' + min_version,
76
78
                        "http://0install.net/2006/interfaces/0compile.xml",
77
79
                        'gui',
80
82
 
81
83
        # Prompt user to choose source version
82
84
        c = Command()
83
 
        c.run(['0launch', '--gui', '--source', '--download-only', interface.uri], build)
 
85
        c.run(['0launch',
 
86
                '--message', 'Download the source code to be compiled',
 
87
                '--gui', '--source', '--download-only', interface.uri], build)