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

« back to all changes in this revision

Viewing changes to zeroinstall/injector/cli.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:
36
36
        from zeroinstall.injector import gpg, handler
37
37
        from zeroinstall.injector.iface_cache import PendingFeed
38
38
        from xml.dom import minidom
 
39
        handler = handler.Handler()
 
40
 
39
41
        for x in args:
40
42
                if not os.path.isfile(x):
41
43
                        raise SafeException("File '%s' does not exist" % x)
52
54
 
53
55
                pending = PendingFeed(uri, signed_data)
54
56
 
55
 
                handler = handler.Handler()
56
 
 
57
57
                def run():
58
58
                        keys_downloaded = tasks.Task(pending.download_keys(handler), "download keys")
59
59
                        yield keys_downloaded.finished
218
218
                                gui_args.append('--download-only')
219
219
                        if options.refresh:
220
220
                                gui_args.append('--refresh')
 
221
                        if options.systray:
 
222
                                gui_args.append('--systray')
221
223
                        if options.not_before:
222
224
                                gui_args.insert(0, options.not_before)
223
225
                                gui_args.insert(0, '--not-before')
226
228
                                gui_args.insert(0, '--before')
227
229
                        if options.source:
228
230
                                gui_args.insert(0, '--source')
 
231
                        if options.message:
 
232
                                gui_args.insert(0, options.message)
 
233
                                gui_args.insert(0, '--message')
229
234
                        if options.verbose:
230
235
                                gui_args.insert(0, '--verbose')
231
236
                                if options.verbose > 1:
312
317
        parser.add_option("-i", "--import", help="import from files, not from the network", action='store_true')
313
318
        parser.add_option("-l", "--list", help="list all known interfaces", action='store_true')
314
319
        parser.add_option("-m", "--main", help="name of the file to execute")
 
320
        parser.add_option("", "--message", help="message to display when interacting with user")
315
321
        parser.add_option("", "--not-before", help="minimum version to choose", metavar='VERSION')
316
322
        parser.add_option("", "--os", help="target operation system type", metavar='OS')
317
323
        parser.add_option("-o", "--offline", help="try to avoid using the network", action='store_true')
318
324
        parser.add_option("-r", "--refresh", help="refresh all used interfaces", action='store_true')
319
325
        parser.add_option("", "--set-selections", help="run versions specified in XML file", metavar='FILE')
320
326
        parser.add_option("-s", "--source", help="select source code", action='store_true')
 
327
        parser.add_option("", "--systray", help="download in the background", action='store_true')
321
328
        parser.add_option("-v", "--verbose", help="more verbose output", action='count')
322
329
        parser.add_option("-V", "--version", help="display version information", action='store_true')
323
330
        parser.add_option("-w", "--wrapper", help="execute program using a debugger, etc", metavar='COMMAND')
340
347
                elif options.version:
341
348
                        import zeroinstall
342
349
                        print "0launch (zero-install) " + zeroinstall.version
343
 
                        print "Copyright (C) 2007 Thomas Leonard"
 
350
                        print "Copyright (C) 2009 Thomas Leonard"
344
351
                        print "This program comes with ABSOLUTELY NO WARRANTY,"
345
352
                        print "to the extent permitted by law."
346
353
                        print "You may redistribute copies of this program"
350
357
                        from zeroinstall.injector import selections, qdom, run
351
358
                        sels = selections.Selections(qdom.parse(file(options.set_selections)))
352
359
                        _download_missing_selections(options, sels)
353
 
                        run.execute_selections(sels, args, options.dry_run, options.main, options.wrapper)
 
360
                        if not options.download_only:
 
361
                                run.execute_selections(sels, args, options.dry_run, options.main, options.wrapper)
354
362
                elif getattr(options, 'import'):
355
363
                        _import_feed(args)
356
364
                elif options.feed: