Don't kill downloads with --refresh.
[zeroinstall.git] / 0launch-gui
blob2240702207ab66abe95cf98f390d1e286bacc44e
1 #!/usr/bin/env python
2 import os, sys
3 from optparse import OptionParser
5 __builtins__._ = lambda x: x
7 parser = OptionParser(usage="usage: %prog [options] interface [args]")
8 parser.add_option("-d", "--download-only", help="fetch but don't run", action='store_true')
9 parser.add_option("-r", "--refresh", help="refresh all used interfaces", action='store_true')
11 parser.disable_interspersed_args()
13 (options, args) = parser.parse_args()
15 if len(args) < 1:
16 parser.print_help()
17 sys.exit(1)
19 interface_uri = args[0]
20 prog_args = args[1:]
22 import model
23 from gui import GUIPolicy
24 import gui, gtk
26 gtk.rc_parse_string('style "scrolled" { '
27 'GtkScrolledWindow::scrollbar-spacing = 0}\n'
28 'class "GtkScrolledWindow" style : gtk "scrolled"\n')
30 policy = GUIPolicy(interface_uri, prog_args,
31 download_only = bool(options.download_only))
32 if options.refresh:
33 policy.refresh_all(force = False)
34 policy.main()