~ubuntu-branches/ubuntu/raring/hplip/raring-proposed

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-05-26 11:20:39 UTC
  • mfrom: (1.5.6) (31.1.3 precise)
  • Revision ID: package-import@ubuntu.com-20120526112039-bevxczegxnbyr5m7
Tags: 3.12.4-1
* New upstream release
* Switch to source/format 3.0 (quilt) - drop dpatch
* Refreshed debian/patches
* dh_autoreconf debian/autogen.sh & set local-options single-debian-patch
* Update to debian/compat -> 9
* Fix "hardened build flags" patch from Moritz - thanks (Closes: #667828)
* Fix "duplex descriptor uninitialized" patch from Matej (Closes: #583273)
* Fix "please migrate to kde-runtime" patch from Pino (Closes: #666544)

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
                    run_as_root_ok=True)
135
135
 
136
136
opts, device_uri, printer_name, mode, ui_toolkit, loc = \
137
 
    mod.parseStdOpts('axp:P:f:t:b:d:r',
 
137
    mod.parseStdOpts('axp:P:f:t:b:d:rq',
138
138
                     ['ttl=', 'filter=', 'search=', 'find=',
139
139
                      'method=', 'time-out=', 'timeout=',
140
140
                      'printer=', 'fax=', 'type=', 'port=',
152
152
testpage_in_auto_mode = True
153
153
jd_port = 1
154
154
remove = False
 
155
ignore_plugin_check = False
155
156
 
156
157
for o, a in opts:
157
158
    if o == '-x':
199
200
 
200
201
    elif o in ('-r', '--rm', '--remove'):
201
202
        remove = True
 
203
    elif o in ('-q'):
 
204
        ignore_plugin_check = True
202
205
 
203
206
 
204
207
try:
373
376
        plugin = mq.get('plugin', PLUGIN_NONE)
374
377
 
375
378
        plugin_installed = utils.to_bool(sys_state.get('plugin', 'installed', '0'))
376
 
        if plugin > PLUGIN_NONE and not plugin_installed:
 
379
        if ignore_plugin_check is False and plugin > PLUGIN_NONE and not plugin_installed:
377
380
            tui.header("PLUG-IN INSTALLATION")
378
381
 
379
382
            hp_plugin = utils.which('hp-plugin')
417
420
 
418
421
            printer_default_model = default_model
419
422
 
 
423
            installed_printer_names = device.getSupportedCUPSPrinterNames(['hp'])
420
424
            # Check for duplicate names
421
 
            if device_uri in installed_print_devices and \
422
 
                printer_default_model in installed_print_devices[device_uri]:
 
425
            if (device_uri in installed_print_devices and printer_default_model in installed_print_devices[device_uri]) \
 
426
               or (printer_default_model in installed_printer_names):
423
427
                    i = 2
424
428
                    while True:
425
429
                        t = printer_default_model + "_%d" % i
426
 
                        if t not in installed_print_devices[device_uri]:
 
430
                        if (t not in installed_printer_names) and(device_uri not in installed_print_devices or t not in installed_print_devices[device_uri]):
427
431
                            printer_default_model += "_%d" % i
428
432
                            break
429
433
                        i += 1
483
487
                print_ppd, desc = print_ppd
484
488
                log.info("\nFound PPD file: %s" % print_ppd)
485
489
 
486
 
                if desc:
487
 
                    log.info("Description: %s" % desc)
 
490
                log.info("Description: %s" % desc)
488
491
#
489
 
                    if not auto:
490
 
                        log.info("\nNote: The model number may vary slightly from the actual model number on the device.")
491
 
                        ok, ans = tui.enter_yes_no("\nDoes this PPD file appear to be the correct one")
492
 
                        if not ok: sys.exit(0)
493
 
                        if not ans: enter_ppd = True
 
492
                if not auto:
 
493
                    log.info("\nNote: The model number may vary slightly from the actual model number on the device.")
 
494
                    ok, ans = tui.enter_yes_no("\nDoes this PPD file appear to be the correct one")
 
495
                    if not ok: sys.exit(0)
 
496
                    if not ans: enter_ppd = True
494
497
 
495
498
 
496
499
            if enter_ppd:
629
632
 
630
633
            fax_default_model = default_model + '_fax'
631
634
 
 
635
            installed_fax_names = device.getSupportedCUPSPrinterNames(['hpfax'])
632
636
            # Check for duplicate names
633
 
            if fax_uri in installed_fax_devices and \
634
 
                fax_default_model in installed_fax_devices[fax_uri]:
 
637
            if (fax_uri in installed_fax_devices and fax_default_model in installed_fax_devices[fax_uri]) \
 
638
                or (fax_default_model in installed_fax_names):
635
639
                    i = 2
636
640
                    while True:
637
641
                        t = fax_default_model + "_%d" % i
638
 
                        if t not in installed_fax_devices[fax_uri]:
 
642
                        if (t in installed_fax_names) and (fax_uri not in installed_fax_devices or t not in installed_fax_devices[fax_uri]):
639
643
                            fax_default_model += "_%d" % i
640
644
                            break
641
645
                        i += 1