~ubuntu-branches/ubuntu/vivid/hplip/vivid-security

« back to all changes in this revision

Viewing changes to testpage.py

  • Committer: Package Import Robot
  • Author(s): Till Kamppeter
  • Date: 2015-02-04 21:18:00 UTC
  • mfrom: (1.8.2)
  • Revision ID: package-import@ubuntu.com-20150204211800-3ahjuezv75ah97zz
Tags: 3.15.2-0ubuntu1
* New upstream release
  - Python3 support for HPLIP
  - Doesn't build against libjpeg-turbo 1.3.90 (LP: #1388126)
  - hpcups crashes if DEVICE_URI not set in environment (LP: #1395676)
  - Incorrect call to hpmudext.device_open (LP: #1388007)
  - plugin download fails if python links to python3 (LP: #1187055)
  - Incorrect IEEE 1284 Device IDs for many models (LP: #802999)
* debian/patches/85_rebuild_python_ui.dpatch: Manually updated to apply to new
  upstream source code.
* debian/patches/hp_photosmart_pro_b9100_support.dpatch,
  debian/patches/simple-scan-as-default.dpatch,
  debian/patches/hpfax-bug-function-used-before-importing-log.dpatch,
  debian/patches/hp-systray-make-menu-title-visible-in-sni-qt-indicator.dpatch,
  debian/patches/hp-systray-make-menu-appear-in-sni-qt-indicator-with-kde.dpatch,
  debian/patches/hpaio-option-duplex.diff,
  debian/patches/musb-c-do-not-crash-on-usb-failure.patch,
  debian/patches/process-events-for-systray.patch: Refreshed with quilt.
* debian/rules: Force Python3 build using PYTHON=python3 ./configure option
* debian/rules: Use py3versions to get system's Python3 interpreter version
* debian/rules: Use relative symlink for /usr/sbin/hpssd, so that shebang
  correction works.
* debian/rules: Make sure that the Python interpreter paths in all executables
  use python3.
* debian/rules: Use dh_python3 instead of dh_python2.
* debian/control: Replaced all Python-related dependencies by their
  Python3 equivalent.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
    opts, device_uri, printer_name, mode, ui_toolkit, loc = \
50
50
        mod.parseStdOpts()
51
51
 
52
 
    printer_name, device_uri = mod.getPrinterName(printer_name, device_uri)
53
52
    wait_for_printout = False
 
53
    sts, printer_name, device_uri = mod.getPrinterName(printer_name, device_uri)
 
54
 
 
55
    if not sts:
 
56
        log.error("No installed printers found (or) Invalid printer device selected")
 
57
        sys.exit(1)
54
58
 
55
59
    if mode == GUI_MODE:
56
60
        if not utils.canEnterGUIMode4():
69
73
 
70
74
        if 1:
71
75
            app = QApplication(sys.argv)
72
 
 
73
76
            dialog = PrintTestPageDialog(None, printer_name)
74
77
            dialog.show()
75
78
            try:
84
87
    #else: # INTERACTIVE_MODE
85
88
        try:
86
89
            d = device.Device(device_uri, printer_name)
87
 
        except Error, e:
 
90
        except Error as e:
88
91
            log.error("Device error (%s)." % e.msg)
89
92
            sys.exit(1)
90
93
 
104
107
                log.info( "Printing test page to printer %s..." % printer_name)
105
108
                try:
106
109
                    d.printTestPage(printer_name)
107
 
                except Error, e:
 
110
                except Error as e:
108
111
                    if e.opt == ERROR_NO_CUPS_QUEUE_FOUND_FOR_DEVICE:
109
112
                        log.error("No CUPS queue found for device. Please install the printer in CUPS and try again.")
110
113
                    else:
121
124
 
122
125
                            try:
123
126
                                d.queryDevice(quick=True)
124
 
                            except Error, e:
 
127
                            except Error as e:
125
128
                                log.error("An error has occured.")
126
129
 
127
130
                            if d.error_state == ERROR_STATE_CLEAR: