diff -Nru hplip-3.16.3+repack0/align.py hplip-3.16.5+repack0/align.py --- hplip-3.16.3+repack0/align.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/align.py 2016-05-06 12:28:03.000000000 +0000 @@ -31,12 +31,18 @@ import getopt import operator import os -#from __future__ import absolute_import + + # Local from base.g import * from base import device, status, utils, maint, tui, module from prnt import cups +try: + from importlib import import_module +except ImportError as e: + log.debug(e) + from base.utils import dyn_import_mod as import_module def enterAlignmentNumber(letter, hortvert, colors, line_count, maximum): ok, value = tui.enter_range("From the printed Alignment page, Enter the best aligned value for line %s (1-%d): " % @@ -130,7 +136,7 @@ try: mod = module.Module(__mod__, __title__, __version__, __doc__, None, - (INTERACTIVE_MODE, GUI_MODE), (UI_TOOLKIT_QT4,)) + (INTERACTIVE_MODE, GUI_MODE), (UI_TOOLKIT_QT4, UI_TOOLKIT_QT5)) mod.setUsage(module.USAGE_FLAG_DEVICE_ARGS, see_also_list=['hp-clean', 'hp-colorcal', 'hp-linefeedcal', @@ -228,18 +234,20 @@ d.close() else: # GUI_MODE (qt4) - try: - from PyQt4.QtGui import QApplication - from ui4.aligndialog import AlignDialog - except ImportError: - log.error("Unable to load Qt4 support. Is it installed?") - sys.exit(1) + # try: + # from PyQt4.QtGui import QApplication + # from ui4.aligndialog import AlignDialog + # except ImportError: + # log.error("Unable to load Qt4 support. Is it installed?") + # sys.exit(1) + QApplication, ui_package = utils.import_dialog(ui_toolkit) + ui = import_module(ui_package + ".aligndialog") #try: if 1: app = QApplication(sys.argv) - dlg = AlignDialog(None, device_uri) + dlg = ui.AlignDialog(None, device_uri) dlg.show() try: log.debug("Starting GUI loop...") diff -Nru hplip-3.16.3+repack0/base/avahi.py hplip-3.16.5+repack0/base/avahi.py --- hplip-3.16.3+repack0/base/avahi.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/base/avahi.py 2016-05-06 12:28:03.000000000 +0000 @@ -66,5 +66,3 @@ log.debug("Found %d devices" % len(found_devices)) return found_devices - - diff -Nru hplip-3.16.3+repack0/base/codes.py hplip-3.16.5+repack0/base/codes.py --- hplip-3.16.3+repack0/base/codes.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/base/codes.py 2016-05-06 12:28:03.000000000 +0000 @@ -33,7 +33,8 @@ # Supported UI toolkits UI_TOOLKIT_QT3 = 0 UI_TOOLKIT_QT4 = 1 -UI_TOOLKIT_GTK = 2 # Not used +UI_TOOLKIT_QT5 = 2 +UI_TOOLKIT_GTK = 3 # Not used # device types (CUPS queue or SANE types) DEVICE_TYPE_UNKNOWN = 0 diff -Nru hplip-3.16.3+repack0/base/device.py hplip-3.16.5+repack0/base/device.py --- hplip-3.16.3+repack0/base/device.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/base/device.py 2016-05-06 12:28:03.000000000 +0000 @@ -26,7 +26,7 @@ import gzip import os.path import time -from .sixext.moves import urllib_request, urllib_parse, urllib_error # TODO: Replace with urllib2 (urllib is deprecated in Python 3.0) +from .sixext.moves import urllib_request, urllib_parse, urllib_error import io from io import BytesIO from .sixext.moves import http_client diff -Nru hplip-3.16.3+repack0/base/models.py hplip-3.16.5+repack0/base/models.py --- hplip-3.16.3+repack0/base/models.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/base/models.py 2016-05-06 12:28:03.000000000 +0000 @@ -117,6 +117,8 @@ "Kapan", "MimasTDR", "Saipan15B", + "Gemstone", + "SPDOfficejetProAsize", ] TECH_CLASSES.sort() @@ -183,6 +185,8 @@ "Kapan" : 'pcl3', "MimasTDR" : 'pcl3', "Saipan15B" : 'pcl3', + "Gemstone" : 'pcl3', + "SPDOfficejetProAsize" : 'pcl3', } PDL_TYPE_PCL = 0 # less preferred diff -Nru hplip-3.16.3+repack0/base/module.py hplip-3.16.5+repack0/base/module.py --- hplip-3.16.3+repack0/base/module.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/base/module.py 2016-05-06 12:28:03.000000000 +0000 @@ -79,6 +79,10 @@ self.installed_ui_toolkits.append(UI_TOOLKIT_QT4) self.num_installed_ui_toolkits += 1 + if utils.to_bool(sys_conf.get('configure', 'qt5', '0')): + self.installed_ui_toolkits.append(UI_TOOLKIT_QT5) + self.num_installed_ui_toolkits += 1 + self.default_mode = INTERACTIVE_MODE self.num_valid_modes = 0 @@ -109,8 +113,8 @@ self.default_ui_toolkit = 'none' elif (UI_TOOLKIT_QT4 in self.supported_ui_toolkits and self.default_ui_toolkit == 'qt4' and UI_TOOLKIT_QT4 in self.installed_ui_toolkits) or \ - (UI_TOOLKIT_QT3 in self.supported_ui_toolkits and self.default_ui_toolkit == 'qt3' and UI_TOOLKIT_QT3 in self.installed_ui_toolkits): - + (UI_TOOLKIT_QT3 in self.supported_ui_toolkits and self.default_ui_toolkit == 'qt3' and UI_TOOLKIT_QT3 in self.installed_ui_toolkits) or \ + (UI_TOOLKIT_QT5 in self.supported_ui_toolkits and self.default_ui_toolkit == 'qt5' and UI_TOOLKIT_QT5 in self.installed_ui_toolkits): self.default_mode = GUI_MODE elif self.default_ui_toolkit == 'qt3' and UI_TOOLKIT_QT3 not in self.supported_ui_toolkits: @@ -118,6 +122,9 @@ if UI_TOOLKIT_QT4 in self.supported_ui_toolkits and UI_TOOLKIT_QT4 in self.installed_ui_toolkits: # (e.g, hp-linefeedcal?) self.default_ui_toolkit = 'qt4' self.default_mode = GUI_MODE + if UI_TOOLKIT_QT5 in self.supported_ui_toolkits and UI_TOOLKIT_QT5 in self.installed_ui_toolkits: + self.default_ui_toolkit = 'qt5' + self.default_mode = GUI_MODE elif INTERACTIVE_MODE in self.avail_modes: self.default_mode = INTERACTIVE_MODE @@ -205,6 +212,10 @@ if UI_TOOLKIT_QT4 in self.supported_ui_toolkits and UI_TOOLKIT_QT4 in self.installed_ui_toolkits: content.append(utils.USAGE_USE_QT4) + if UI_TOOLKIT_QT5 in self.supported_ui_toolkits and UI_TOOLKIT_QT5 in self.installed_ui_toolkits: + content.append(utils.USAGE_USE_QT5) + + content.append(utils.USAGE_LOGGING1) content.append(utils.USAGE_LOGGING2) if include_flags & USAGE_FLAG_SUPRESS_G_DEBUG_FLAG != USAGE_FLAG_SUPRESS_G_DEBUG_FLAG: @@ -379,6 +390,18 @@ ui_toolkit = 'qt4' else: error_msg.append("%s does not support Qt4. Unable to enter GUI mode." % self.mod) + + elif o in ('--qt5', '--use-qt5'): + if self.avail_modes is not None and GUI_MODE in self.avail_modes: + if self.supported_ui_toolkits is not None and \ + UI_TOOLKIT_QT5 in self.supported_ui_toolkits and prop.gui_build and \ + UI_TOOLKIT_QT5 in self.installed_ui_toolkits: + + mode = GUI_MODE + ui_toolkit = 'qt5' + else: + error_msg.append("%s does not support Qt4. Unable to enter GUI mode." % self.mod) + #elif o in ('--lang', '--loc'): # if a.strip() == '?': diff -Nru hplip-3.16.3+repack0/base/password.py hplip-3.16.5+repack0/base/password.py --- hplip-3.16.3+repack0/base/password.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/base/password.py 2016-05-06 12:28:03.000000000 +0000 @@ -110,11 +110,12 @@ self.__readAuthType() #self.__authType self.__expectList =[] - if not utils.to_bool(sys_conf.get('configure','qt4', '0')) and utils.to_bool(sys_conf.get('configure','qt3', '0')): + if not utils.to_bool(sys_conf.get('configure','qt5', '0')) and not not utils.to_bool(sys_conf.get('configure','qt4', '0')) and utils.to_bool(sys_conf.get('configure','qt3', '0')): self.__ui_toolkit = 'qt3' - else: + elif not utils.to_bool(sys_conf.get('configure','qt5', '0')) and not utils.to_bool(sys_conf.get('configure','qt3', '0')) and utils.to_bool(sys_conf.get('configure','qt4', '0')): self.__ui_toolkit = 'qt4' - + elif not utils.to_bool(sys_conf.get('configure','qt3', '0')) and not utils.to_bool(sys_conf.get('configure','qt4', '0')) and utils.to_bool(sys_conf.get('configure','qt5', '0')): + self.__ui_toolkit = 'qt5' for s in utils.EXPECT_WORD_LIST: try: @@ -171,6 +172,9 @@ if self.__ui_toolkit == "qt3": from ui.setupform import showPasswordUI username, password = showPasswordUI(pswd_msg, user, False) + elif self.__ui_toolkit == "qt5": + from ui5.setupdialog import showPasswordUI + username, password = showPasswordUI(pswd_msg, user, False) else: #self.__ui_toolkit == "qt4" --> default qt4 from ui4.setupdialog import showPasswordUI username, password = showPasswordUI(pswd_msg, user, False) @@ -273,7 +277,9 @@ if self.__mode == GUI_MODE: if self.__ui_toolkit == "qt4": from ui4.setupdialog import FailureMessageUI - if self.__ui_toolkit == "qt3": + elif self.__ui_toolkit == "qt5": + from ui5.setupdialog import FailureMessageUI + elif self.__ui_toolkit == "qt3": from ui.setupform import FailureMessageUI diff -Nru hplip-3.16.3+repack0/base/queues.py hplip-3.16.5+repack0/base/queues.py --- hplip-3.16.3+repack0/base/queues.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/base/queues.py 2016-05-06 12:28:03.000000000 +0000 @@ -32,6 +32,12 @@ from installer import core_install from .sixext import to_string_utf8 +try: + from importlib import import_module +except ImportError as e: + log.debug(e) + from .utils import dyn_import_mod as import_module + # ppd type HPCUPS = 1 @@ -368,15 +374,12 @@ log.error("This is not supported in Qt3, requires GUI support (try running with --qt4). Also, try using interactive (-i) mode.") sys.exit(1) - try: - from PyQt4.QtGui import QApplication, QMessageBox - from ui4.queuesconf import QueuesDiagnose - from ui4 import setupdialog - except ImportError: - log.error("Unable to load Qt4 support. Is it installed?") - sys.exit(1) + QApplication, ui_package = utils.import_dialog(ui_toolkit) + ui = import_module(ui_package + ".queuesconf") + setupdialog = import_module(ui_package + ".setupdialog") + app = QApplication(sys.argv) - dialog = QueuesDiagnose(None, "","",QUEUES_MSG_SENDING,passwordObj) + dialog = ui.QueuesDiagnose(None, "","",QUEUES_MSG_SENDING,passwordObj) cups.setPasswordCallback(setupdialog.showPasswordUI) mapofDevices,status = parseQueues(mode) diff -Nru hplip-3.16.3+repack0/base/utils.py hplip-3.16.5+repack0/base/utils.py --- hplip-3.16.3+repack0/base/utils.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/base/utils.py 2016-05-06 12:28:03.000000000 +0000 @@ -61,7 +61,7 @@ try: import dbus - from dbus import SystemBus, lowlevel + from dbus import SystemBus, lowlevel, SessionBus dbus_avail=True except ImportError: dbus_avail=False @@ -711,9 +711,15 @@ log.warn("No display found.") return False - elif not checkPyQtImport4(): - log.warn("Qt/PyQt 4 initialization failed.") - return False + # elif not checkPyQtImport4(): + # log.warn("Qt4/PyQt 4 initialization failed.") + # return False + else: + try: + checkPyQtImport45() + except ImportError as e: + log.warn(e) + return False return True @@ -774,10 +780,22 @@ import PyQt4 import ui4 except ImportError: - log.error("HPLIP is not installed properly or is installed without graphical support. Please reinstall HPLIP") - return False + import PyQt5 + import ui5 else: - return True + log.debug("HPLIP is not installed properly or is installed without graphical support. Please reinstall HPLIP again") + return False + return True + +# def checkPyQtImport5(): +# try: +# import PyQt5 +# import ui5 +# except ImportError: +# log.error("HPLIP is not installed properly or is installed without graphical support PyQt5. Please reinstall HPLIP") +# return False +# else: +# return True try: @@ -1567,10 +1585,15 @@ if sys_conf.get('configure', 'ui-toolkit', 'qt3') == 'qt3': USAGE_USE_QT3 = ("Use Qt3:", "--qt3 (Default)", "option", False) USAGE_USE_QT4 = ("Use Qt4:", "--qt4", "option", False) -else: + USAGE_USE_QT5 = ("Use Qt5:", "--qt5", "option", False) +elif sys_conf.get('configure', 'ui-toolkit', 'qt4') == 'qt4': USAGE_USE_QT3 = ("Use Qt3:", "--qt3", "option", False) USAGE_USE_QT4 = ("Use Qt4:", "--qt4 (Default)", "option", False) - + USAGE_USE_QT5 = ("Use Qt5:", "--qt5", "option", False) +elif sys_conf.get('configure', 'ui-toolkit', 'qt5') == 'qt5': + USAGE_USE_QT3 = ("Use Qt3:", "--qt3", "option", False) + USAGE_USE_QT4 = ("Use Qt4:", "--qt4", "option", False) + USAGE_USE_QT5 = ("Use Qt5:", "--qt5 (Default)", "option", False) def ttysize(): # TODO: Move to base/tui ln1 = subprocess.getoutput('stty -a').splitlines()[0] @@ -2081,7 +2104,7 @@ log.debug("send_message() entered") args = [device_uri, printer_name, event_code, username, job_id, title, pipe_name] - msg = lowlevel.SignalMessage('/', DBUS_SERVICE, 'Event') + msg = lowlevel.SignalMessage(path='/', interface=DBUS_SERVICE, name='Event') msg.append(signature='ssisiss', *args) SystemBus().send_message(msg) log.debug("send_message() returning") @@ -2396,3 +2419,59 @@ data = data[index+2+size+2:len(data)] data = temp return data + + +def checkPyQtImport45(): + try: + import PyQt5 + return "PyQt5" + except ImportError as e: + log.debug(e) + + try: + import PyQt4 + return "PyQt4" + except ImportError as e: + log.debug(e) + + raise ImportError("GUI Modules PyQt4 and PyQt5 are not installed") + + +def ui_status(): + _ui_status = "" + try: + _ui_status = checkPyQtImport45() + log.note("Using GUI Module %s" % _ui_status) + return _ui_status + except ImportError as e: + log.error(e) + + +def import_dialog(ui_toolkit): + if ui_toolkit == "qt4": + try: + from PyQt4.QtGui import QApplication + log.debug("Using PyQt4") + return (QApplication, "ui4") + except ImportError as e: + log.error(e) + sys.exit(1) + elif ui_toolkit == "qt5": + try: + from PyQt5.QtWidgets import QApplication + log.debug("Using PyQt5") + return (QApplication, "ui5") + except ImportError as e: + log.error(e) + sys.exit(1) + else: + log.error("Unable to load Qt support. Is it installed?") + sys.exit(1) + + +def dyn_import_mod(mod_name_as_str): + components = mod_name_as_str.split('.') + mod = __import__(mod_name_as_str) + for comp in components[1:]: + mod = getattr(mod, comp) + return mod diff -Nru hplip-3.16.3+repack0/check-plugin.py hplip-3.16.5+repack0/check-plugin.py --- hplip-3.16.3+repack0/check-plugin.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/check-plugin.py 2016-05-06 12:28:03.000000000 +0000 @@ -161,7 +161,8 @@ log.error("hp-check-plugin Tool requires dBus and python-dbus") sys.exit(1) try: - mod = module.Module(__mod__, __title__, __version__, __doc__, USAGE, (INTERACTIVE_MODE, GUI_MODE), (UI_TOOLKIT_QT3, UI_TOOLKIT_QT4), run_as_root_ok=True, quiet=True) + mod = module.Module(__mod__, __title__, __version__, __doc__, USAGE, + (INTERACTIVE_MODE, GUI_MODE), (UI_TOOLKIT_QT3, UI_TOOLKIT_QT4, UI_TOOLKIT_QT5), run_as_root_ok=True, quiet=True) opts, device_uri, printer_name, mode, ui_toolkit, loc = \ mod.parseStdOpts('l:hHuUmMfFpPgG',['gui','help', 'help-rest', 'help-man', 'help-desc','logging='],handle_device_printer=False) diff -Nru hplip-3.16.3+repack0/check.py hplip-3.16.5+repack0/check.py --- hplip-3.16.3+repack0/check.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/check.py 2016-05-06 12:28:03.000000000 +0000 @@ -69,11 +69,6 @@ Ver_Func_Pat = re.compile('''FUNC#(.*)''') -EXTERNALDEP = 1 -GENERALDEP = 2 -COMPILEDEP = 3 -PYEXT = 4 -SCANCONF = 5 IS_LIBUSB01_ENABLED = 'no' ############ Functions ######### @@ -172,12 +167,12 @@ ########## Classes ########### #DependenciesCheck class derived from CoreInstall -class DependenciesCheck(CoreInstall): - def __init__(self,mode=MODE_CHECK, ui_mode=INTERACTIVE_MODE, ui_toolkit='qt4'): - CoreInstall.__init__(self,mode,ui_mode,ui_toolkit) +class DependenciesCheck(object): + def __init__(self, mode=MODE_CHECK, ui_mode=INTERACTIVE_MODE, ui_toolkit='qt4'): + # CoreInstall.__init__(self,mode,ui_mode,ui_toolkit) self.num_errors = 0 self.num_warns = 0 - + self.core = CoreInstall(mode, ui_mode, ui_toolkit) # self.missing_user_grps = '' self.ui_toolkit = ui_toolkit # self.disable_selinux = False @@ -187,14 +182,16 @@ self.comm_error_devices = {} self.plugin_status = '' self.smart_install_devices = [] - + self.user_grps_cmd = '' def __update_deps_info(self, sup_dist_vers, d, deps_info): if d == 'cups-ddk' and self.cups_ddk_not_req == True: return - elif self.ui_toolkit != 'qt4' and self.ui_toolkit != 'qt3' and d == 'pyqt': + elif self.ui_toolkit != 'qt5' and self.ui_toolkit != 'qt4' and self.ui_toolkit != 'qt3' and d == 'pyqt': + return + elif d == 'pyqt' and self.ui_toolkit == 'qt5': return elif d == 'pyqt' and self.ui_toolkit == 'qt4': return @@ -202,15 +199,15 @@ return elif d == 'hpaio' and not self.scanning_enabled: return - elif self.distro_name =="rhel" and "5." in self.distro_version: + elif self.core.distro =="rhel" and "5." in self.distro_version: if d in ['dbus','python-devel','python-dbus','pyqt4-dbus','libnetsnmp-devel','gcc','make','reportlab','policykit','sane-devel','cups-ddk']: return if deps_info[6] is None: installed_ver = '-' elif Ver_Func_Pat.search(deps_info[6]): - if deps_info[6] in self.version_func: - installed_ver = self.version_func[deps_info[6]]() + if deps_info[6] in self.core.version_func: + installed_ver = self.core.version_func[deps_info[6]]() else: installed_ver = '-' else: @@ -218,26 +215,26 @@ Status = Status_Type(deps_info[3](),deps_info[5],installed_ver) comment = get_comment(d, Status, installed_ver) packages_to_install, commands=[],[] - if self.is_auto_installer_support(): - packages_to_install, commands = self.get_dependency_data(d) + if self.core.is_auto_installer_support(): + packages_to_install, commands = self.core.get_dependency_data(d) if not packages_to_install and d == 'hpaio': packages_to_install.append(d) else: - packages_to_install, commands = self.get_dependency_data(d,sup_dist_vers) + packages_to_install, commands = self.core.get_dependency_data(d,sup_dist_vers) if not packages_to_install and d == 'hpaio': packages_to_install.append(d) - + if deps_info[0]: package_type = "REQUIRED" else: package_type = "OPTIONAL" - + if d == 'cups' and ((installed_ver == '-') or check_version(installed_ver,'1.4')): self.cups_ddk_not_req = True log.debug("cups -ddk not required as cups version [%s] is => 1.4 "%installed_ver) if d == 'hpmudext' and Status == 'OK': self.hpmudext_avail = True - + if Status == 'OK': log.info(" %-20s %-60s %-15s %-15s %-15s %-10s %s" %(d,deps_info[2], package_type,deps_info[5],installed_ver,Status,comment)) else: @@ -303,19 +300,19 @@ log.set_where(log.LOG_TO_FILE) IS_LIBUSB01_ENABLED = sys_conf.get('configure', 'libusb01-build', 'no') - vrs =self.get_distro_data('versions_list') - supported_distro_vrs= self.distro_version - if self.distro_version not in vrs and len(vrs): + vrs =self.core.get_distro_data('versions_list') + supported_distro_vrs= self.core.distro_version + if self.core.distro_version not in vrs and len(vrs): supported_distro_vrs= vrs[len(vrs)-1] log.warn(log.bold("%s-%s version is not supported. Using %s-%s versions dependencies to verify and install..." \ - %(self.distro_name, self.distro_version, self.distro_name, supported_distro_vrs))) - + %(self.core.distro, self.core.distro_version, self.core.distro, supported_distro_vrs))) + tui.header("SYSTEM INFO") Sts, Kernel_info =utils.run("uname -r -v -o") Sts, Host_info =utils.run("uname -n") Sts, Proc_info =utils.run("uname -r -v -o") log.info(" Kernel: %s Host: %s Proc: %s Distribution: %s %s"\ - %(Kernel_info,Host_info,Proc_info,self.distro_name, self.distro_version)) + %(Kernel_info,Host_info,Proc_info,self.core.distro, self.core.distro_version)) log.info(" Bitness: %s bit\n"%utils.getBitness()) tui.header("HPLIP CONFIGURATION") v = sys_conf.get('hplip', 'version') @@ -323,10 +320,10 @@ home = sys_conf.get('dirs', 'home') log.info("HPLIP-Version: HPLIP %s" %v) log.info("HPLIP-Home: %s" %home) - if self.is_auto_installer_support(): - log.info("HPLIP-Installation: Auto installation is supported for %s distro %s version " %(self.distro_name, self.distro_version)) + if self.core.is_auto_installer_support(): + log.info("HPLIP-Installation: Auto installation is supported for %s distro %s version " %(self.core.distro_name, self.core.distro_version)) else: - log.warn("HPLIP-Installation: Auto installation is not supported for %s distro %s version " %(self.distro_name, self.distro_version)) + log.warn("HPLIP-Installation: Auto installation is not supported for %s distro %s version " %(self.core.distro, self.core.distro_version)) log.info() log.info(log.bold("Current contents of '/etc/hp/hplip.conf' file:")) @@ -360,41 +357,50 @@ self.scanning_enabled = utils.to_bool(sys_conf.get('configure', 'scanner-build', '0')) log.info(" %-20s %-20s %-10s %-10s %-10s %-10s %s"%( "", " ", "", "","", "", "")) - self.dependencies.update(self.hplip_dependencies) + self.core.dependencies.update(self.core.hplip_dependencies) if time_flag == DEPENDENCY_RUN_AND_COMPILE_TIME or time_flag == DEPENDENCY_RUN_TIME: - tui.header(" External Dependencies") - for dep in self.dependencies: - if self.dependencies[dep][7] == EXTERNALDEP: - self.__update_deps_info(supported_distro_vrs, dep, self.dependencies[dep]) - - tui.header(" General Dependencies") - for dep in self.dependencies: - if self.dependencies[dep][7] == GENERALDEP: - self.__update_deps_info(supported_distro_vrs, dep, self.dependencies[dep]) - - tui.header(" COMPILEDEP") - for dep in self.dependencies: - if self.dependencies[dep][7] == COMPILEDEP: - self.__update_deps_info(supported_distro_vrs, dep, self.dependencies[dep]) - - tui.header(" Python Extentions") - for dep in self.dependencies: - if self.dependencies[dep][7] == PYEXT: - self.__update_deps_info(supported_distro_vrs, dep, self.dependencies[dep]) - - tui.header(" Scan Configuration") - for dep in self.dependencies: - if self.dependencies[dep][7] == SCANCONF: - self.__update_deps_info(supported_distro_vrs, dep, self.dependencies[dep]) - - tui.header(" Other Dependencies") - for dep in self.dependencies: - if self.dependencies[dep][7] != SCANCONF and \ - self.dependencies[dep][7] != PYEXT and \ - self.dependencies[dep][7] != COMPILEDEP and \ - self.dependencies[dep][7] != GENERALDEP and \ - self.dependencies[dep][7] != EXTERNALDEP: - self.__update_deps_info(supported_distro_vrs, dep, self.dependencies[dep]) + dep_dict = { "External Dependencies": EXTERNALDEP, "General Dependencies": GENERALDEP, "COMPILEDEP": COMPILEDEP, "Python Extentions": PYEXT, "Scan Configuration": SCANCONF } + for dep_check in dep_dict: + tui.header(dep_check) + for dep in self.core.dependencies: + if self.core.dependencies[dep][7] == dep_dict[dep_check] and any([self.core.selected_options[x] for x in self.core.dependencies[dep][1]]): + self.__update_deps_info(supported_distro_vrs, dep, + self.core.dependencies[dep]) + + # tui.header(" External Dependencies") + # for dep in self.dependencies: + # if self.dependencies[dep][7] == EXTERNALDEP: + # self.__update_deps_info(supported_distro_vrs, dep, self.dependencies[dep]) + + # tui.header(" General Dependencies") + # for dep in self.dependencies: + # if self.dependencies[dep][7] == GENERALDEP: + # self.__update_deps_info(supported_distro_vrs, dep, self.dependencies[dep]) + + # tui.header(" COMPILEDEP") + # for dep in self.dependencies: + # if self.dependencies[dep][7] == COMPILEDEP: + # self.__update_deps_info(supported_distro_vrs, dep, self.dependencies[dep]) + + # tui.header(" Python Extentions") + # for dep in self.dependencies: + # if self.dependencies[dep][7] == PYEXT: + # self.__update_deps_info(supported_distro_vrs, dep, self.dependencies[dep]) + + # tui.header(" Scan Configuration") + # for dep in self.dependencies: + # if self.dependencies[dep][7] == SCANCONF: + # self.__update_deps_info(supported_distro_vrs, dep, self.dependencies[dep]) + + # tui.header(" Other Dependencies") + # for dep in self.dependencies: + # if self.dependencies[dep][7] in dep_dict: + # # if self.dependencies[dep][7] != SCANCONF and \ + # # self.dependencies[dep][7] != PYEXT and \ + # # self.dependencies[dep][7] != COMPILEDEP and \ + # # self.dependencies[dep][7] != GENERALDEP and \ + # # self.dependencies[dep][7] != EXTERNALDEP: + # self.__update_deps_info(supported_distro_vrs, dep, self.dependencies[dep]) if self.scanning_enabled: tui.header("DISCOVERED SCANNER DEVICES") @@ -517,13 +523,13 @@ status, output = utils.run('lpstat -p%s' % printer_name) log.info("Printer status: %s" % output.replace("\n", "")) - if back_end == 'hpfax' and not 'HP Fax' in desc and desc != '': + if back_end == 'hpfax' and desc and not 'HP Fax' in desc: self.num_errors += 1 - log.error("Incorrect PPD file for fax queue '%s'. Fax queues must use 'HP-Fax(n)-hpcups.ppd'." % printer_name) + log.error("Incorrect PPD file for fax queue '%s'. Fax queues must use 'HP-Fax-hplip.ppd'." % printer_name) - elif back_end == 'hp' and 'HP Fax' in desc and desc != '': + elif back_end == 'hp' and desc and 'HP Fax' in desc: self.num_errors += 1 - log.error("Incorrect PPD file for a print queue '%s'. Print queues must not use 'HP-Fax(n)-hpcups.ppd'." % printer_name) + log.error("Incorrect PPD file for a print queue '%s'. Print queues must not use 'HP-Fax-hplip.ppd'." % printer_name) elif back_end not in ('hp', 'hpfax'): log.warn("Printer is not HPLIP installed. Printers must use the hp: or hpfax: CUPS backend for HP-Devices.") @@ -851,12 +857,12 @@ show_title() ui_toolkit = sys_conf.get('configure','ui-toolkit') - core = DependenciesCheck(MODE_CHECK,INTERACTIVE_MODE,ui_toolkit) - core.init() - num_errors, num_warns = core.validate(time_flag, is_quiet_mode) + dep = DependenciesCheck(MODE_CHECK,INTERACTIVE_MODE,ui_toolkit) + dep.core.init() + num_errors, num_warns = dep.validate(time_flag, is_quiet_mode) if num_errors or num_warns: - core.display_summary() + dep.display_summary() else: log.info(log.green("No errors or warnings.")) diff -Nru hplip-3.16.3+repack0/clean.py hplip-3.16.5+repack0/clean.py --- hplip-3.16.3+repack0/clean.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/clean.py 2016-05-06 12:28:03.000000000 +0000 @@ -38,6 +38,12 @@ from base import device, utils, maint, tui, module from prnt import cups +try: + from importlib import import_module +except ImportError as e: + log.debug(e) + from base.utils import dyn_import_mod as import_module + def CleanUIx(level): global d @@ -105,7 +111,7 @@ try: mod = module.Module(__mod__, __title__, __version__, __doc__, None, - (INTERACTIVE_MODE, GUI_MODE), (UI_TOOLKIT_QT4,)) + (INTERACTIVE_MODE, GUI_MODE), (UI_TOOLKIT_QT4, UI_TOOLKIT_QT5)) mod.setUsage(module.USAGE_FLAG_DEVICE_ARGS, see_also_list=['hp-align', 'hp-clean', 'hp-linefeedcal', @@ -185,18 +191,15 @@ d.close() else: - try: - from PyQt4.QtGui import QApplication - from ui4.cleandialog import CleanDialog - except ImportError: - log.error("Unable to load Qt4 support. Is it installed?") - sys.exit(1) + + QApplication, ui_package = utils.import_dialog(ui_toolkit) + ui = import_module(ui_package + ".cleandialog") #try: if 1: app = QApplication(sys.argv) - dlg = CleanDialog(None, device_uri) + dlg = ui.CleanDialog(None, device_uri) dlg.show() try: log.debug("Starting GUI loop...") diff -Nru hplip-3.16.3+repack0/configure hplip-3.16.5+repack0/configure --- hplip-3.16.3+repack0/configure 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/configure 2016-05-06 12:28:03.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for HP Linux Imaging and Printing 3.16.3. +# Generated by GNU Autoconf 2.68 for HP Linux Imaging and Printing 3.16.5. # -# Report bugs to <3.16.3>. +# Report bugs to <3.16.5>. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -246,7 +246,7 @@ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org and 3.16.3 about your + $as_echo "$0: Please tell bug-autoconf@gnu.org and 3.16.5 about your $0: system, including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." @@ -569,9 +569,9 @@ # Identity of this package. PACKAGE_NAME='HP Linux Imaging and Printing' PACKAGE_TARNAME='hplip' -PACKAGE_VERSION='3.16.3' -PACKAGE_STRING='HP Linux Imaging and Printing 3.16.3' -PACKAGE_BUGREPORT='3.16.3' +PACKAGE_VERSION='3.16.5' +PACKAGE_STRING='HP Linux Imaging and Printing 3.16.5' +PACKAGE_BUGREPORT='3.16.5' PACKAGE_URL='' # Factoring default headers for most tests. @@ -629,6 +629,7 @@ epm_full epm_qt3 epm_qt4 +epm_qt5 epm_hpcups_install epm_hpijs_install epm_cups_drv_install @@ -636,6 +637,7 @@ epm_cups_ppd_install epm_foomatic_ppd_install epm_foomatic_rip_hplip_install +qt5 qt4 qt3 platform @@ -700,6 +702,8 @@ QT3_INSTALL_TRUE QT4_INSTALL_FALSE QT4_INSTALL_TRUE +QT5_INSTALL_FALSE +QT5_INSTALL_TRUE RIP_INSTALL_FALSE RIP_INSTALL_TRUE CUPS_PPD_INSTALL_FALSE @@ -904,6 +908,7 @@ enable_cups_drv_install enable_cups_ppd_install enable_foomatic_rip_hplip_install +enable_qt5 enable_qt4 enable_qt3 enable_policykit @@ -1470,7 +1475,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HP Linux Imaging and Printing 3.16.3 to adapt to many kinds of systems. +\`configure' configures HP Linux Imaging and Printing 3.16.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1540,7 +1545,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HP Linux Imaging and Printing 3.16.3:";; + short | recursive ) echo "Configuration of HP Linux Imaging and Printing 3.16.5:";; esac cat <<\_ACEOF @@ -1578,6 +1583,7 @@ --enable-cups-drv-install enable cups dynamic ppd install (default=yes), uses drvdir and hpppddir --enable-cups-ppd-install enable cups static ppd install (default=no), uses hpppddir --enable-foomatic-rip-hplip-install enable foomatic-rip-hplip install (default=no)(Deprecated), uses cupsfilterdir + --enable-qt5 enable qt5 (default=no) --enable-qt4 enable qt4 (default=yes) --enable-qt3 enable qt3 (default=no) --enable-policykit enable PolicyKit (default=no) @@ -1638,7 +1644,7 @@ Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to <3.16.3>. +Report bugs to <3.16.5>. _ACEOF ac_status=$? fi @@ -1701,7 +1707,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HP Linux Imaging and Printing configure 3.16.3 +HP Linux Imaging and Printing configure 3.16.5 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2168,7 +2174,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## --------------------- ## -## Report this to 3.16.3 ## +## Report this to 3.16.5 ## ## --------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -2245,7 +2251,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HP Linux Imaging and Printing $as_me 3.16.3, which was +It was created by HP Linux Imaging and Printing $as_me 3.16.5, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3061,7 +3067,7 @@ # Define the identity of the package. PACKAGE='hplip' - VERSION='3.16.3' + VERSION='3.16.5' cat >>confdefs.h <<_ACEOF @@ -16444,6 +16450,32 @@ fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for qt5" >&5 +$as_echo_n "checking for qt5... " >&6; } +# Check whether --enable-qt5 was given. +if test "${enable_qt5+set}" = set; then : + enableval=$enable_qt5; qt5=$enableval +else + qt5=no +fi + +if test "$qt5" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test x$qt5 = xyes; then + QT5_INSTALL_TRUE= + QT5_INSTALL_FALSE='#' +else + QT5_INSTALL_TRUE='#' + QT5_INSTALL_FALSE= +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for qt4" >&5 $as_echo_n "checking for qt4... " >&6; } # Check whether --enable-qt4 was given. @@ -16497,17 +16529,22 @@ if test "$gui_build" = "no"; then qt3=no qt4=no + qt5=no fi epm_qt3=\# epm_qt4=\# +epm_qt5=\# if test "$hpcups_only_build" = "no" && test "$hpijs_only_build" = "no"; then -if test "$qt3" = "yes" && test "$qt4" = "no"; then +if test "$qt3" = "yes" && test "$qt4" = "no" && "$qt5" = "no"; then ui_toolkit=qt3 epm_qt3= elif test "$qt4" = "yes"; then ui_toolkit=qt4 epm_qt4= +elif test "$qt5" = "yes"; then + ui_toolkit=qt5 + epm_qt5= else ui_toolkit=no fi @@ -17619,6 +17656,8 @@ + + ac_config_files="$ac_config_files Makefile hplip.conf hplip.desktop hplip-systray.desktop prnt/drv/hpijs.drv prnt/drv/hpcups.drv hplip.list data/policykit/com.hp.hplip.service" cat >confcache <<\_ACEOF @@ -17879,6 +17918,10 @@ as_fn_error $? "conditional \"RIP_INSTALL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${QT5_INSTALL_TRUE}" && test -z "${QT5_INSTALL_FALSE}"; then + as_fn_error $? "conditional \"QT5_INSTALL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${QT4_INSTALL_TRUE}" && test -z "${QT4_INSTALL_FALSE}"; then as_fn_error $? "conditional \"QT4_INSTALL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -18300,7 +18343,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HP Linux Imaging and Printing $as_me 3.16.3, which was +This file was extended by HP Linux Imaging and Printing $as_me 3.16.5, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18351,13 +18394,13 @@ Configuration commands: $config_commands -Report bugs to <3.16.3>." +Report bugs to <3.16.5>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HP Linux Imaging and Printing config.status 3.16.3 +HP Linux Imaging and Printing config.status 3.16.5 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff -Nru hplip-3.16.3+repack0/configure.in hplip-3.16.5+repack0/configure.in --- hplip-3.16.3+repack0/configure.in 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/configure.in 2016-05-06 12:28:03.000000000 +0000 @@ -26,7 +26,7 @@ # 104 = no libdl #AC_PREREQ(2.59) -AC_INIT([HP Linux Imaging and Printing], [3.16.3], [3.16.3], [hplip]) +AC_INIT([HP Linux Imaging and Printing], [3.16.5], [3.16.5], [hplip]) #AM_INIT_AUTOMAKE([1.9 foreign]) AM_INIT_AUTOMAKE AC_DISABLE_STATIC @@ -434,6 +434,18 @@ fi AM_CONDITIONAL(RIP_INSTALL, test x$foomatic_rip_hplip_install = xyes) +AC_MSG_CHECKING([for qt5]) +AC_ARG_ENABLE(qt5, + [ --enable-qt5 enable qt5 (default=no)], + qt5=$enableval, qt5=no) +if test "$qt5" = "yes"; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi +AM_CONDITIONAL(QT5_INSTALL, test x$qt5 = xyes) + + AC_MSG_CHECKING([for qt4]) AC_ARG_ENABLE(qt4, [ --enable-qt4 enable qt4 (default=yes)], @@ -459,17 +471,22 @@ if test "$gui_build" = "no"; then qt3=no qt4=no + qt5=no fi epm_qt3=\# epm_qt4=\# +epm_qt5=\# if test "$hpcups_only_build" = "no" && test "$hpijs_only_build" = "no"; then -if test "$qt3" = "yes" && test "$qt4" = "no"; then +if test "$qt3" = "yes" && test "$qt4" = "no" && "$qt5" = "no"; then ui_toolkit=qt3 epm_qt3= elif test "$qt4" = "yes"; then ui_toolkit=qt4 epm_qt4= +elif test "$qt5" = "yes"; then + ui_toolkit=qt5 + epm_qt5= else ui_toolkit=no fi @@ -650,6 +667,7 @@ AC_SUBST(platform) AC_SUBST(qt3) AC_SUBST(qt4) +AC_SUBST(qt5) AC_SUBST(epm_foomatic_rip_hplip_install) AC_SUBST(epm_foomatic_ppd_install) AC_SUBST(epm_cups_ppd_install) @@ -657,6 +675,7 @@ AC_SUBST(epm_cups_drv_install) AC_SUBST(epm_hpijs_install) AC_SUBST(epm_hpcups_install) +AC_SUBST(epm_qt5) AC_SUBST(epm_qt4) AC_SUBST(epm_qt3) AC_SUBST(epm_full) diff -Nru hplip-3.16.3+repack0/cups_drv.inc hplip-3.16.5+repack0/cups_drv.inc --- hplip-3.16.3+repack0/cups_drv.inc 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/cups_drv.inc 2016-05-06 12:28:03.000000000 +0000 @@ -514,6 +514,7 @@ ppd/hpcups/hp-officejet.ppd.gz \ ppd/hpcups/hp-officejet_100_mobile_l411.ppd.gz \ ppd/hpcups/hp-officejet_150_mobile_l511.ppd.gz \ + ppd/hpcups/hp-officejet_200_mobile_series.ppd.gz \ ppd/hpcups/hp-officejet_2620_series.ppd.gz \ ppd/hpcups/hp-officejet_3830_series.ppd.gz \ ppd/hpcups/hp-officejet_4000_k210.ppd.gz \ @@ -604,6 +605,8 @@ ppd/hpcups/hp-officejet_pro_8630.ppd.gz \ ppd/hpcups/hp-officejet_pro_8640.ppd.gz \ ppd/hpcups/hp-officejet_pro_8660.ppd.gz \ + ppd/hpcups/hp-officejet_pro_8710.ppd.gz \ + ppd/hpcups/hp-officejet_pro_8720.ppd.gz \ ppd/hpcups/hp-officejet_pro_k5300.ppd.gz \ ppd/hpcups/hp-officejet_pro_k5400.ppd.gz \ ppd/hpcups/hp-officejet_pro_k550.ppd.gz \ diff -Nru hplip-3.16.3+repack0/data/models/models.dat hplip-3.16.5+repack0/data/models/models.dat --- hplip-3.16.3+repack0/data/models/models.dat 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/data/models/models.dat 2016-05-06 12:28:03.000000000 +0000 @@ -59663,6 +59663,320 @@ usb-vid=3f0 wifi-config=3 + +[officejet_200_mobile_series] +align-type=0 +clean-type=0 +color-cal-type=0 +copy-type=0 +embedded-server-type=0 +fax-type=0 +fw-download=False +icon=officejet_k80.png +io-mfp-mode=1 +io-mode=1 +io-support=10 +job-storage=0 +linefeed-cal-type=0 +model1=HP OfficeJet 200 Mobile Printer +monitor-type=0 +panel-check-type=0 +pcard-type=0 +plugin=0 +plugin-reason=0 +power-settings=0 +pq-diag-type=0 +r-type=0 +scan-src=0 +scan-type=0 +status-battery-check=0 +status-dynamic-counters=0 +status-type=10 +support-released=True +support-subtype=447b +support-type=2 +support-ver=3.16.5 +tech-class=Gemstone +tech-subclass=Normal +tech-type=4 +usb-pid=e711 +usb-vid=3f0 +wifi-config=3 + +[hp_officejet_pro_8710] +align-type=0 +clean-type=0 +color-cal-type=0 +copy-type=0 +embedded-server-type=1 +fax-type=6 +fw-download=False +icon=hp_color_laserjet_cp2025.png +io-mfp-mode=1 +io-mode=1 +io-support=14 +job-storage=0 +linefeed-cal-type=0 +model1=HP OfficeJet Pro 8710 All-in-One Printer +model2=HP OfficeJet Pro 8715 All-in-One Printer +monitor-type=0 +panel-check-type=0 +pcard-type=0 +plugin=0 +plugin-reason=0 +power-settings=0 +pq-diag-type=0 +r-type=1 +r0-agent1-kind=4 +r0-agent1-sku=F6U11A/F6U15A +r0-agent1-type=1 +r0-agent2-kind=4 +r0-agent2-sku=F6U08A/F6U12A +r0-agent2-type=4 +r0-agent3-kind=4 +r0-agent3-sku=F6U09A/F6U13A +r0-agent3-type=5 +r0-agent4-kind=4 +r0-agent4-sku=F6U10A/F6U14A +r0-agent4-type=6 +r1-agent1-kind=4 +r1-agent1-sku=F6U19A +r1-agent1-type=1 +r1-agent2-kind=4 +r1-agent2-sku=F6U16A +r1-agent2-type=4 +r1-agent3-kind=4 +r1-agent3-sku=F6U17A +r1-agent3-type=5 +r1-agent4-kind=4 +r1-agent4-sku=F6U18A +r1-agent4-type=6 +scan-src=3 +scan-type=7 +status-battery-check=0 +status-dynamic-counters=0 +status-type=10 +support-released=True +support-subtype=48c3 +support-type=2 +support-ver=3.16.5 +tech-class=SPDOfficejetProAsize +tech-subclass=Normal +tech-type=4 +usb-pid=7A12 +usb-vid=3f0 +wifi-config=3 + + +[hp_officejet_pro_8740] +align-type=0 +clean-type=0 +color-cal-type=0 +copy-type=0 +embedded-server-type=1 +fax-type=6 +fw-download=False +icon=hp_color_laserjet_cp2025.png +io-mfp-mode=1 +io-mode=1 +io-support=14 +job-storage=0 +linefeed-cal-type=0 +model1=HP OfficeJet Pro 8740 All-in-One Printer +monitor-type=0 +panel-check-type=0 +pcard-type=0 +plugin=0 +plugin-reason=0 +power-settings=0 +ppd-name=hp-officejet_pro_8740 +pq-diag-type=0 +r-type=1 +r0-agent1-kind=4 +r0-agent1-sku=F6U11A/F6U15A +r0-agent1-type=1 +r0-agent2-kind=4 +r0-agent2-sku=F6U08A/F6U12A +r0-agent2-type=4 +r0-agent3-kind=4 +r0-agent3-sku=F6U09A/F6U13A +r0-agent3-type=5 +r0-agent4-kind=4 +r0-agent4-sku=F6U10A/F6U14A +r0-agent4-type=6 +r1-agent1-kind=4 +r1-agent1-sku=F6U19A +r1-agent1-type=1 +r1-agent2-kind=4 +r1-agent2-sku=F6U16A +r1-agent2-type=4 +r1-agent3-kind=4 +r1-agent3-sku=F6U17A +r1-agent3-type=5 +r1-agent4-kind=4 +r1-agent4-sku=F6U18A +r1-agent4-type=6 +scan-src=3 +scan-type=7 +status-battery-check=0 +status-dynamic-counters=0 +status-type=10 +support-released=True +support-subtype=48c3 +support-type=2 +support-ver=3.16.5 +tech-class=Postscript +tech-subclass=Normal +tech-type=4 +usb-pid=6312 +usb-vid=3f0 +wifi-config=3 + +[hp_officejet_pro_8720] +align-type=0 +clean-type=0 +color-cal-type=0 +copy-type=0 +embedded-server-type=1 +fax-type=6 +fw-download=False +icon=hp_color_laserjet_cp2025.png +io-mfp-mode=1 +io-mode=1 +io-support=14 +job-storage=0 +linefeed-cal-type=0 +model1=HP OfficeJet Pro 8720 All-in-One Printer +model2=HP OfficeJet Pro 8725 All-in-One Printer +monitor-type=0 +panel-check-type=0 +pcard-type=0 +plugin=0 +plugin-reason=0 +power-settings=0 +ppd-name=hp-officejet_pro_8720 +pq-diag-type=0 +r-type=1 +r0-agent1-kind=4 +r0-agent1-sku=F6U11A/F6U15A +r0-agent1-type=1 +r0-agent2-kind=4 +r0-agent2-sku=F6U08A/F6U12A +r0-agent2-type=4 +r0-agent3-kind=4 +r0-agent3-sku=F6U09A/F6U13A +r0-agent3-type=5 +r0-agent4-kind=4 +r0-agent4-sku=F6U10A/F6U14A +r0-agent4-type=6 +r1-agent1-kind=4 +r1-agent1-sku=F6U19A +r1-agent1-type=1 +r1-agent2-kind=4 +r1-agent2-sku=F6U16A +r1-agent2-type=4 +r1-agent3-kind=4 +r1-agent3-sku=F6U17A +r1-agent3-type=5 +r1-agent4-kind=4 +r1-agent4-sku=F6U18A +r1-agent4-type=6 +scan-src=3 +scan-type=7 +status-battery-check=0 +status-dynamic-counters=0 +status-type=10 +support-released=True +support-subtype=48c3 +support-type=2 +support-ver=3.16.5 +tech-class=SPDOfficejetProAsize +tech-subclass=Normal +tech-type=4 +usb-pid=7b12 +usb-vid=3f0 +wifi-config=3 + +[hp_laserjet_pro_m501n] +align-type=0 +clean-type=0 +color-cal-type=0 +copy-type=0 +embedded-server-type=1 +fax-type=0 +fw-download=False +icon=officejet_k550.png +io-mfp-mode=1 +io-mode=1 +io-support=6 +job-storage=0 +linefeed-cal-type=0 +model1=HP Laserjet Pro M501n +monitor-type=0 +ppd-name=laserjet_pro_m501n +panel-check-type=0 +pcard-type=0 +plugin=0 +plugin-reason=0 +power-settings=0 +pq-diag-type=0 +scan-src=0 +scan-type=0 +status-battery-check=0 +status-dynamic-counters=0 +status-type=10 +support-released=True +support-subtype=219b2b +support-type=2 +support-ver=3.16.5 +tech-class=Postscript +tech-subclass=Normal +tech-type=2 +usb-pid=652a +usb-vid=3f0 +wifi-config=0 + + +[hp_laserjet_pro_m501dn] +align-type=0 +clean-type=0 +color-cal-type=0 +copy-type=0 +embedded-server-type=1 +fax-type=0 +fw-download=False +icon=officejet_k550.png +io-mfp-mode=1 +io-mode=1 +io-support=6 +job-storage=0 +linefeed-cal-type=0 +model1=HP Laserjet Pro M501dn +monitor-type=0 +ppd-name=laserjet_pro_m501dn +panel-check-type=1 +pcard-type=0 +plugin=0 +plugin-reason=0 +power-settings=0 +pq-diag-type=0 +scan-src=0 +scan-type=0 +status-battery-check=0 +status-dynamic-counters=0 +status-type=10 +support-released=True +support-subtype=219b2b +support-type=2 +support-ver=3.16.5 +tech-class=Postscript +tech-subclass=Normal +tech-type=2 +usb-pid=652a +usb-vid=3f0 +wifi-config=0 + + # align-type # ---------- # Align cartridges type diff -Nru hplip-3.16.3+repack0/debian/changelog hplip-3.16.5+repack0/debian/changelog --- hplip-3.16.3+repack0/debian/changelog 2016-03-19 10:38:22.000000000 +0000 +++ hplip-3.16.5+repack0/debian/changelog 2016-05-10 08:42:32.000000000 +0000 @@ -1,3 +1,16 @@ +hplip (3.16.5+repack0-1) unstable; urgency=medium + + * Imported Upstream version 3.16.5 + * Switch to Qt5 (Closes: #793458) + * Bump Standards-Version to 3.9.8 + * Actually rebuild the UI files we use (Qt5), not the Qt3 ones + * Update Vcs-Git and Vcs-Browser to use canonical HTTPS URIs + * Rebuild UI files and make imports relative + * Port Qt4 patches to Qt5 + * Remove 85_rebuild_python_ui.patch, rebuilding in rules now + + -- Julian Andres Klode Tue, 10 May 2016 10:42:14 +0200 + hplip (3.16.3+repack0-1) unstable; urgency=medium * Imported Upstream version 3.16.3 diff -Nru hplip-3.16.3+repack0/debian/control hplip-3.16.5+repack0/debian/control --- hplip-3.16.3+repack0/debian/control 2016-03-19 10:38:22.000000000 +0000 +++ hplip-3.16.5+repack0/debian/control 2016-05-10 08:42:32.000000000 +0000 @@ -29,15 +29,15 @@ patch (>= 2.5.9-3bpo1), policykit-1, pyppd (>= 1.0.1), - pyqt4-dev-tools, + pyqt5-dev-tools, python3-all-dev (>= 2.6.6-3~), python3-dbus (>= 0.80), python3-dev, - python3-pyqt4 -Standards-Version: 3.9.7 + python3-pyqt5 +Standards-Version: 3.9.8 Homepage: http://hplipopensource.com/hplip-web/index.html -Vcs-Git: https://alioth.debian.org/anonscm/git/printing/hplip.git -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=printing/hplip.git +Vcs-Git: https://anonscm.debian.org/git/printing/hplip.git +Vcs-Browser: https://anonscm.debian.org/git/printing/hplip.git Package: hplip Architecture: any @@ -125,8 +125,8 @@ Depends: dbus-x11, gksu | kdebase-bin (<< 4:4.4.0-1) | kde-runtime | kdebase-runtime | kdesudo | ktsuss, hplip (>= ${source:Version}), - python3-dbus.mainloop.qt, - python3-pyqt4, + python3-dbus.mainloop.pyqt5, + python3-pyqt5, ${misc:Depends}, ${python3:Depends} Recommends: python3-notify2, xsane | simple-scan | skanlite diff -Nru hplip-3.16.3+repack0/debian/patches/85_rebuild_python_ui.patch hplip-3.16.5+repack0/debian/patches/85_rebuild_python_ui.patch --- hplip-3.16.3+repack0/debian/patches/85_rebuild_python_ui.patch 2016-03-19 10:38:22.000000000 +0000 +++ hplip-3.16.5+repack0/debian/patches/85_rebuild_python_ui.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -Author: -Description: No description. - ---- a/Makefile.am -+++ b/Makefile.am -@@ -3,6 +3,11 @@ - # - # (c) 2004-2015 Copyright HP Development Company, LP - # Author: David Suffield, Naga Samrat Chowdary Narla, Sarbeswar Meher -+ -+# Generic rules -+%.py: %.ui -+ $(PYUIC4) -x -o $@ $< -+ - INCLUDES = -Iip -Iio/hpmud -Iscan/sane -Iprnt/hpijs -Icommon/ - CFLAGS+= -DCONFDIR=\"$(hplip_confdir)\" - CXXFLAGS+= -DCONFDIR=\"$(hplip_confdir)\" ---- a/configure.in -+++ b/configure.in -@@ -558,6 +558,8 @@ - [FOUND_HEADER=yes; break;]) - AS_IF([test "x$FOUND_HEADER" != "xyes"], - [AC_MSG_ERROR([cannot find python-devel support], 6)]) -+ AC_ARG_VAR([PYUIC4], [PyQT pyuic4 .ui to .py compiler command]) -+ AC_CHECK_TOOLS([PYUIC4], [pyuic4]) - fi - - if test "$hpijs_only_build" = "no" && test "$scan_build" = "yes" && test "$hpcups_only_build" = "no"; then diff -Nru hplip-3.16.3+repack0/debian/patches/hp-systray-make-menu-appear-in-sni-qt-indicator-with-kde.patch hplip-3.16.5+repack0/debian/patches/hp-systray-make-menu-appear-in-sni-qt-indicator-with-kde.patch --- hplip-3.16.3+repack0/debian/patches/hp-systray-make-menu-appear-in-sni-qt-indicator-with-kde.patch 2016-03-19 10:38:22.000000000 +0000 +++ hplip-3.16.5+repack0/debian/patches/hp-systray-make-menu-appear-in-sni-qt-indicator-with-kde.patch 2016-05-10 08:42:32.000000000 +0000 @@ -1,9 +1,9 @@ Author: Description: No description. ---- a/ui4/systemtray.py -+++ b/ui4/systemtray.py -@@ -569,6 +569,9 @@ +--- a/ui5/systemtray.py ++++ b/ui5/systemtray.py +@@ -576,6 +576,9 @@ class SystemTrayApp(QApplication): elif reason == QSystemTrayIcon.Trigger: #print "single click" diff -Nru hplip-3.16.3+repack0/debian/patches/hp-systray-make-menu-title-visible-in-sni-qt-indicator.patch hplip-3.16.5+repack0/debian/patches/hp-systray-make-menu-title-visible-in-sni-qt-indicator.patch --- hplip-3.16.3+repack0/debian/patches/hp-systray-make-menu-title-visible-in-sni-qt-indicator.patch 2016-03-19 10:38:22.000000000 +0000 +++ hplip-3.16.5+repack0/debian/patches/hp-systray-make-menu-title-visible-in-sni-qt-indicator.patch 2016-05-10 08:42:32.000000000 +0000 @@ -1,22 +1,23 @@ Author: Description: No description. ---- a/ui4/systemtray.py -+++ b/ui4/systemtray.py -@@ -437,29 +437,11 @@ +--- a/ui5/systemtray.py ++++ b/ui5/systemtray.py +@@ -442,30 +442,13 @@ class SystemTrayApp(QApplication): def setMenu(self): self.menu = QMenu() - title = QWidgetAction(self.menu) + title = QAction(self.menu) #title.setDisabled(True) -- + - hbox = QFrame(self.menu) - layout = QHBoxLayout(hbox) -- layout.setMargin(3) +- # layout.setMargin(3) +- layout.setContentsMargins(3, 3, 3, 3) - layout.setSpacing(5) - pix_label = QLabel(hbox) -- + - layout.insertWidget(-1, pix_label, 0) - - icon_size = self.menu.style().pixelMetric(QStyle.PM_SmallIconSize) diff -Nru hplip-3.16.3+repack0/debian/patches/series hplip-3.16.5+repack0/debian/patches/series --- hplip-3.16.3+repack0/debian/patches/series 2016-03-19 10:38:22.000000000 +0000 +++ hplip-3.16.5+repack0/debian/patches/series 2016-05-10 08:42:32.000000000 +0000 @@ -1,6 +1,5 @@ 01_rss.patch 14_charsign_fixes.patch -85_rebuild_python_ui.patch hp_photosmart_pro_b9100_support.patch pjl-duplex-binding.patch simple-scan-as-default.patch @@ -17,3 +16,4 @@ order-page-sizes-consistently.patch install-check-plugin.diff HP-LaserJet_4000-PostScript-PPD.patch +ui-patch-upstream-like.patch diff -Nru hplip-3.16.3+repack0/debian/patches/simple-scan-as-default.patch hplip-3.16.5+repack0/debian/patches/simple-scan-as-default.patch --- hplip-3.16.3+repack0/debian/patches/simple-scan-as-default.patch 2016-03-19 10:38:22.000000000 +0000 +++ hplip-3.16.5+repack0/debian/patches/simple-scan-as-default.patch 2016-05-10 08:42:32.000000000 +0000 @@ -3,7 +3,7 @@ --- a/base/utils.py +++ b/base/utils.py -@@ -567,18 +567,21 @@ +@@ -565,18 +565,21 @@ class UserSettings(object): # Note: Depr # Scan self.cmd_scan = '' @@ -32,9 +32,9 @@ # Photo Card path = which('hp-unload') ---- a/ui4/ui_utils.py -+++ b/ui4/ui_utils.py -@@ -188,7 +188,7 @@ +--- a/ui5/ui_utils.py ++++ b/ui5/ui_utils.py +@@ -205,7 +205,7 @@ class UserSettings(QSettings): return '' def loadDefaults(self): diff -Nru hplip-3.16.3+repack0/debian/patches/ui-patch-upstream-like.patch hplip-3.16.5+repack0/debian/patches/ui-patch-upstream-like.patch --- hplip-3.16.3+repack0/debian/patches/ui-patch-upstream-like.patch 1970-01-01 00:00:00.000000000 +0000 +++ hplip-3.16.5+repack0/debian/patches/ui-patch-upstream-like.patch 2016-05-10 08:42:32.000000000 +0000 @@ -0,0 +1,56 @@ +Description: Patch UI files to match upstream produced .py code + The update tab was manually patched out in the generated code, + and the label_2 was renamed in the code. +Author: Julian Andres Klode + +--- a/ui5/devmgr5_base.ui ++++ b/ui5/devmgr5_base.ui +@@ -547,37 +547,6 @@ + + + +- +- +- Page +- +- +- +- +- 280 +- 40 +- 96 +- 27 +- +- +- +- Install now +- +- +- +- +- +- 30 +- 45 +- 251 +- 17 +- +- +- +- New version of HPLIP-x.x.x is available +- +- +- + + + +--- a/ui5/wifisetupdialog_base.ui ++++ b/ui5/wifisetupdialog_base.ui +@@ -47,7 +47,7 @@ + + + +- ++ + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> + p, li { white-space: pre-wrap; } diff -Nru hplip-3.16.3+repack0/debian/rules hplip-3.16.5+repack0/debian/rules --- hplip-3.16.3+repack0/debian/rules 2016-03-19 10:38:22.000000000 +0000 +++ hplip-3.16.5+repack0/debian/rules 2016-05-10 08:42:32.000000000 +0000 @@ -62,7 +62,7 @@ -rm -f prnt/hpijs/platform.h prnt/hpijs/auto-include.h find -type d -name build -print0 | xargs -0 -r rm -rf \; # We prefer to regenerate these using pyuic - (cd ui && for i in *.ui ; do rm -f $${i%.ui}.py ; done) + (cd ui5 && for i in *.ui ; do rm -f $${i%.ui}.py ; done) ## @@ -95,17 +95,27 @@ --enable-gui-build \ --enable-fax-build \ --disable-qt3 \ - --enable-qt4 \ + --disable-qt4 \ + --enable-qt5 \ --enable-policykit \ --enable-udev-acl-rules - override_dh_auto_build: # Compress various files before building, they are needed for the build, and were # compressed in the non-repacked upstream tarballs -find . -name '*.ppd' | xargs ${GZIP} -f -find data/ -regextype posix-extended -regex '.*\.(ldl|pcl|ps|pdf)' | xargs ${GZIP} -f + # Rebuild the UI files and patch the imports to be relative + (set -e; cd ui5; \ + for i in *.ui ; do pyuic5 -o $${i%.ui}.py $$i; done; \ + modules=$$(for i in *.py; do echo -n $${i%%.py}\|; done; echo dummyalternative); \ + sed -r "s#from ($$modules)#from .\1#" -i *.py \ + ) + # Patch out retranslateUi call like upstream does + sed -i s/self.retranslateUi/#self.retranslateUi/ ui5/devmgr5_base.py + + dh_auto_build diff -Nru hplip-3.16.3+repack0/devicesettings.py hplip-3.16.5+repack0/devicesettings.py --- hplip-3.16.3+repack0/devicesettings.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/devicesettings.py 2016-05-06 12:28:03.000000000 +0000 @@ -40,8 +40,15 @@ try: + from importlib import import_module +except ImportError as e: + log.debug(e) + from base.utils import dyn_import_mod as import_module + + +try: mod = module.Module(__mod__, __title__, __version__, __doc__, None, - (GUI_MODE,), (UI_TOOLKIT_QT4,)) + (GUI_MODE,), (UI_TOOLKIT_QT4, UI_TOOLKIT_QT5)) mod.setUsage(module.USAGE_FLAG_DEVICE_ARGS, see_also_list=['hp-toolbox']) @@ -61,15 +68,17 @@ log.error("%s -u/--gui requires Qt4 GUI support. Exiting." % __mod__) sys.exit(1) - try: - from PyQt4.QtGui import QApplication - from ui4.devicesetupdialog import DeviceSetupDialog - except ImportError: - log.error("Unable to load Qt4 support. Is it installed?") - sys.exit(1) + # try: + # from PyQt4.QtGui import QApplication + # from ui4.devicesetupdialog import DeviceSetupDialog + # except ImportError: + # log.error("Unable to load Qt4 support. Is it installed?") + # sys.exit(1) + QApplication, ui_package = utils.import_dialog(ui_toolkit) + ui = import_module(ui_package + ".devicesetupdialog") app = QApplication(sys.argv) - dlg = DeviceSetupDialog(None, device_uri) + dlg = ui.DeviceSetupDialog(None, device_uri) dlg.show() try: log.debug("Starting GUI loop...") diff -Nru hplip-3.16.3+repack0/diagnose_plugin.py hplip-3.16.5+repack0/diagnose_plugin.py --- hplip-3.16.3+repack0/diagnose_plugin.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/diagnose_plugin.py 2016-05-06 12:28:03.000000000 +0000 @@ -33,10 +33,18 @@ import re import os + # Local from base.g import * from base import utils, module +try: + from importlib import import_module +except ImportError as e: + log.debug(e) + from base.utils import dyn_import_mod as import_module + + def usage(typ='text'): if typ == 'text': utils.log_title(__title__, __version__) @@ -59,7 +67,7 @@ mod = module.Module(__mod__, __title__, __version__, __doc__, USAGE, (INTERACTIVE_MODE, GUI_MODE), - (UI_TOOLKIT_QT3, UI_TOOLKIT_QT4), True) + (UI_TOOLKIT_QT3, UI_TOOLKIT_QT4, UI_TOOLKIT_QT5), True) opts, device_uri, printer_name, mode, ui_toolkit, loc = \ mod.parseStdOpts( handle_device_printer=False) @@ -77,13 +85,17 @@ log.error("%s requires GUI support . Is Qt4 installed?" % __mod__) sys.exit(1) - try: - from PyQt4.QtGui import QApplication, QMessageBox - from ui4.plugindiagnose import PluginDiagnose - from installer import pluginhandler - except ImportError: - log.error("Unable to load Qt4 support. Is it installed?") - sys.exit(1) + # try: + # from PyQt4.QtGui import QApplication, QMessageBox + # from ui4.plugindiagnose import PluginDiagnose + # from installer import pluginhandler + # except ImportError: + # log.error("Unable to load Qt4 support. Is it installed?") + # sys.exit(1) + + QApplication, ui_package = utils.import_dialog(ui_toolkit) + ui = import_module(ui_package + ".plugindiagnose") + from installer import pluginhandler app = QApplication(sys.argv) pluginObj = pluginhandler.PluginHandle() @@ -92,9 +104,9 @@ log.info("Device Plugin is already installed") sys.exit(0) elif plugin_sts == PLUGIN_NOT_INSTALLED: - dialog = PluginDiagnose(None, install_mode, plugin_reason) + dialog = ui.PluginDiagnose(None, install_mode, plugin_reason) else: - dialog = PluginDiagnose(None, install_mode, plugin_reason, True) + dialog = ui.PluginDiagnose(None, install_mode, plugin_reason, True) dialog.show() try: diff -Nru hplip-3.16.3+repack0/diagnose_queues.py hplip-3.16.5+repack0/diagnose_queues.py --- hplip-3.16.3+repack0/diagnose_queues.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/diagnose_queues.py 2016-05-06 12:28:03.000000000 +0000 @@ -59,7 +59,7 @@ log.set_module(__mod__) mod = module.Module(__mod__, __title__, __version__, __doc__, USAGE, (INTERACTIVE_MODE, GUI_MODE), - (UI_TOOLKIT_QT3, UI_TOOLKIT_QT4), + (UI_TOOLKIT_QT3, UI_TOOLKIT_QT4, UI_TOOLKIT_QT5), run_as_root_ok=True,quiet=True) try: opts, device_uri, printer_name, mode, ui_toolkit, loc = mod.parseStdOpts('hl:gsiu', @@ -104,7 +104,7 @@ usage() if not quiet_mode: utils.log_title(__title__, __version__) - + mod.lockInstance(__mod__, True) log_file = os.path.normpath('%s/hplip_queues.log'%prop.user_dir) log.debug(log.bold("Saving output in log file: %s" % log_file)) @@ -118,8 +118,8 @@ passwordObj = password.Password(mode) queues.main_function(passwordObj, mode,ui_toolkit, quiet_mode ) - - + + except KeyboardInterrupt: log.error("User exit") diff -Nru hplip-3.16.3+repack0/doctor.py hplip-3.16.5+repack0/doctor.py --- hplip-3.16.3+repack0/doctor.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/doctor.py 2016-05-06 12:28:03.000000000 +0000 @@ -202,7 +202,7 @@ try: mod = module.Module(__mod__, __title__, __version__, __doc__, USAGE, (INTERACTIVE_MODE, GUI_MODE), - (UI_TOOLKIT_QT3, UI_TOOLKIT_QT4), True) + (UI_TOOLKIT_QT3, UI_TOOLKIT_QT4, UI_TOOLKIT_QT5), True) opts, device_uri, printer_name, mode, ui_toolkit, loc = \ mod.parseStdOpts('hl:gnid:f:w', ['summary-only','help', 'help-rest', 'help-man', 'help-desc', 'interactive', 'gui', 'lang=','logging=', 'debug'], @@ -272,11 +272,11 @@ ui_toolkit = sys_conf.get('configure','ui-toolkit') - core = DependenciesCheck(MODE_CHECK,INTERACTIVE_MODE,ui_toolkit) - core.init() + dep = DependenciesCheck(MODE_CHECK,INTERACTIVE_MODE,ui_toolkit) + dep.core.init() log.info(log.bold("\n\nChecking for Deprecated items....")) - deprecated_check(core) + deprecated_check(dep.core) log.info(log.bold("\n\nChecking for HPLIP updates....")) upgrade_cmd = utils.which('hp-upgrade',True) @@ -292,16 +292,16 @@ ### Dependency check log.info(log.bold("\n\nChecking for Dependencies....")) if SUMMARY_ONLY: - num_errors, num_warns = core.validate(DEPENDENCY_RUN_AND_COMPILE_TIME, True) + num_errors, num_warns = dep.validate(DEPENDENCY_RUN_AND_COMPILE_TIME, True) else: - num_errors, num_warns = core.validate(DEPENDENCY_RUN_AND_COMPILE_TIME, False) + num_errors, num_warns = dep.validate(DEPENDENCY_RUN_AND_COMPILE_TIME, False) if num_errors or num_warns: - if core.get_required_deps() or core.get_optional_deps() or core.get_cmd_to_run(): - display_missing_dependencies(core.get_required_deps(),core.get_optional_deps(), core.get_cmd_to_run()) - authenticate(core) - core.install_missing_dependencies(INTERACTIVE_MODE,core.get_required_deps(),core.get_optional_deps(), core.get_cmd_to_run()) + if dep.get_required_deps() or dep.get_optional_deps() or dep.get_cmd_to_run(): + display_missing_dependencies(dep.get_required_deps(),dep.get_optional_deps(), dep.get_cmd_to_run()) + authenticate(dep.core) + dep.core.install_missing_dependencies(INTERACTIVE_MODE,dep.get_required_deps(),dep.get_optional_deps(), dep.get_cmd_to_run()) log.info(log.bold("\n\nChecking Permissions....")) # if not core.get_missing_user_grps() and not core.get_disable_selinux_status(): @@ -325,11 +325,11 @@ # IS_RESTART_REQ = True log.info(log.bold("\n\nChecking for Configured Queues....")) - queues.main_function(core.passwordObj, MODE,ui_toolkit, False, DEVICE_URI) + queues.main_function(dep.core.passwordObj, MODE,ui_toolkit, False, DEVICE_URI) log.info(log.bold("\n\nChecking for HP Properitery Plugin's....")) ### Check for Plugin Printers - install_plugin(core) + install_plugin(dep) smart_ins_dev_list = smart_install.get_smartinstall_enabled_devices() if smart_ins_dev_list: @@ -339,7 +339,7 @@ log.error("Smart Install is Enabled in '%s' Printer. This needs to be disabled."%printer) log.info(log.bold("\nRefer link '%s' to disable Smart Install manually.\n"%(url))) - comm_err_dev = core.get_communication_error_devs() + comm_err_dev = dep.get_communication_error_devs() if comm_err_dev: log.info(log.bold("\n\nChecking for Printer Status....")) for printer in comm_err_dev: diff -Nru hplip-3.16.3+repack0/fab.py hplip-3.16.5+repack0/fab.py --- hplip-3.16.3+repack0/fab.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/fab.py 2016-05-06 12:28:03.000000000 +0000 @@ -30,11 +30,19 @@ import getopt import os + # Local from base.g import * from base import utils, tui, module from base.sixext.moves import input +try: + from importlib import import_module +except ImportError as e: + log.debug(e) + from base.utils import dyn_import_mod as import_module + + # Console class (from ASPN Python Cookbook) # Author: James Thiele # Date: 27 April 2004 @@ -761,7 +769,7 @@ mod = module.Module(__mod__, __title__, __version__, __doc__, None, (GUI_MODE, INTERACTIVE_MODE), - (UI_TOOLKIT_QT3, UI_TOOLKIT_QT4)) + (UI_TOOLKIT_QT3, UI_TOOLKIT_QT4, UI_TOOLKIT_QT5)) mod.setUsage(module.USAGE_FLAG_NONE) @@ -844,18 +852,16 @@ sys.exit(0) else: # qt4 - try: - from PyQt4.QtGui import QApplication - from ui4.fabwindow import FABWindow - except ImportError: - log.error("Unable to load Qt4 support. Is it installed?") - sys.exit(1) + + QApplication, ui_package = utils.import_dialog(ui_toolkit) + ui = import_module(ui_package + ".fabwindow") + log.set_module("hp-fab(qt4)") if 1: app = QApplication(sys.argv) - fab = FABWindow(None) + fab = ui.FABWindow(None) fab.show() try: diff -Nru hplip-3.16.3+repack0/faxsetup.py hplip-3.16.5+repack0/faxsetup.py --- hplip-3.16.3+repack0/faxsetup.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/faxsetup.py 2016-05-06 12:28:03.000000000 +0000 @@ -39,10 +39,16 @@ from prnt import cups +try: + from importlib import import_module +except ImportError as e: + log.debug(e) + from base.utils import dyn_import_mod as import_module + try: mod = module.Module(__mod__, __title__, __version__, __doc__, None, - (GUI_MODE,), (UI_TOOLKIT_QT4,)) + (GUI_MODE,), (UI_TOOLKIT_QT4, UI_TOOLKIT_QT5)) mod.setUsage(module.USAGE_FLAG_DEVICE_ARGS, see_also_list=['hp-sendfax', 'hp-fab']) @@ -60,15 +66,17 @@ log.error("%s requires Qt4 GUI support. Exiting." % __mod__) sys.exit(1) - try: - from PyQt4.QtGui import QApplication - from ui4.faxsetupdialog import FaxSetupDialog - except ImportError: - log.error("Unable to load Qt4 support. Is it installed?") - sys.exit(1) + # try: + # from PyQt4.QtGui import QApplication + # from ui4.faxsetupdialog import FaxSetupDialog + # except ImportError: + # log.error("Unable to load Qt4 support. Is it installed?") + # sys.exit(1) + QApplication, ui_package = utils.import_dialog(ui_toolkit) + ui = import_module(ui_package + ".faxsetupdialog") app = QApplication(sys.argv) - dlg = FaxSetupDialog(None, device_uri) + dlg = ui.FaxSetupDialog(None, device_uri) dlg.show() try: log.debug("Starting GUI loop...") diff -Nru hplip-3.16.3+repack0/firmware.py hplip-3.16.5+repack0/firmware.py --- hplip-3.16.3+repack0/firmware.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/firmware.py 2016-05-06 12:28:03.000000000 +0000 @@ -33,16 +33,23 @@ import time import os + # Local from base.g import * from base import device, status, utils, tui, module from prnt import cups +try: + from importlib import import_module +except ImportError as e: + log.debug(e) + from base.utils import dyn_import_mod as import_module + try: mod = module.Module(__mod__, __title__, __version__, __doc__, None, (INTERACTIVE_MODE, GUI_MODE, NON_INTERACTIVE_MODE), - (UI_TOOLKIT_QT4, UI_TOOLKIT_QT3), True, True) + (UI_TOOLKIT_QT5, UI_TOOLKIT_QT4, UI_TOOLKIT_QT3), True, True) mod.setUsage(module.USAGE_FLAG_DEVICE_ARGS, extra_options=[ @@ -89,10 +96,10 @@ mode = NON_INTERACTIVE_MODE - if mode == GUI_MODE and ui_toolkit == 'qt4': + if mode == GUI_MODE and (ui_toolkit == 'qt4' or ui_toolkit == 'qt5'): if not utils.canEnterGUIMode4(): - log.error("%s -u/--gui requires Qt4 GUI support. Entering interactive mode." % __mod__) - mode = INTERACTIVE_MODE + log.error("%s -u/--gui requires Qt4/Qt5 GUI support. Entering interactive mode." % __mod__) + mode = INTERACTIVE_MODE4 elif mode == GUI_MODE and ui_toolkit == 'qt3': if not utils.canEnterGUIMode(): @@ -103,13 +110,15 @@ mod.quiet = False if mode == GUI_MODE: - if ui_toolkit == 'qt4': - try: - from PyQt4.QtGui import QApplication - from ui4.firmwaredialog import FirmwareDialog - except ImportError: - log.error("Unable to load Qt4 support. Is it installed?") - sys.exit(1) + if ui_toolkit == 'qt4'or ui_toolkit == 'qt5': + # try: + # from PyQt4.QtGui import QApplication + # from ui4.firmwaredialog import FirmwareDialog + # except ImportError: + # log.error("Unable to load Qt4 support. Is it installed?") + # sys.exit(1) + QApplication, ui_package = utils.import_dialog(ui_toolkit) + ui = import_module(ui_package + ".firmwaredialog") if ui_toolkit == 'qt3': try: @@ -127,11 +136,11 @@ if device_uri: app = QApplication(sys.argv) - dialog = FirmwareDialog(None, device_uri) + dialog = ui.FirmwareDialog(None, device_uri) dialog.show() try: log.debug("Starting GUI loop...") - if ui_toolkit == 'qt4': + if ui_toolkit == 'qt4' or ui_toolkit == 'qt5': app.exec_() elif ui_toolkit == 'qt3': dialog.exec_loop() diff -Nru hplip-3.16.3+repack0/foomatic_drv.inc hplip-3.16.5+repack0/foomatic_drv.inc --- hplip-3.16.3+repack0/foomatic_drv.inc 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/foomatic_drv.inc 2016-05-06 12:28:03.000000000 +0000 @@ -795,6 +795,7 @@ prnt/ps/hp-laserjet_100_color_mfp_m175-ps.ppd.gz \ prnt/ps/hp-color_laserjet_mfp_m680-ps.ppd.gz \ prnt/ps/hp-laserjet_mfp_m630-ps.ppd.gz \ + prnt/ps/hp-officejet_pro_8730-ps.ppd.gz \ prnt/ps/hp-color_laserjet_pro_mfp_m277-ps.ppd.gz \ prnt/ps/hp-designjet_t920-postscript.ppd.gz \ prnt/ps/hp-laserjet_4100_series-ps.ppd.gz \ @@ -978,6 +979,7 @@ prnt/ps/hp-laserjet_m5035_mfp-ps.ppd.gz \ prnt/ps/hp-laserjet_9065mfp-ps.ppd.gz \ prnt/ps/hp-laserjet_pro_m706-ps.ppd.gz \ + prnt/ps/hp-laserjet_pro_m501dn-ps.ppd.gz \ prnt/ps/hp-laserjet_m2727_mfp_series-ps.ppd.gz \ prnt/ps/hp-laserjet_m1530_mfp_series-ps.ppd.gz \ prnt/ps/hp-color_laserjet_4550-ps.ppd.gz \ @@ -1033,6 +1035,7 @@ prnt/ps/hp-laserjet_1200n-ps.ppd.gz \ prnt/ps/hp-laserjet_3390-ps.ppd.gz \ prnt/ps/hp-laserjet_m604_m605_m606-ps.ppd.gz \ + prnt/ps/hp-laserjet_pro_m501n-ps.ppd.gz \ prnt/ps/hp-color_laserjet_m452d-ps.ppd.gz \ prnt/ps/hp-laserjet_m4349_mfp-ps.ppd.gz \ prnt/ps/hp-designjet_4500mfp.ppd.gz \ diff -Nru hplip-3.16.3+repack0/hplip.conf.in hplip-3.16.5+repack0/hplip.conf.in --- hplip-3.16.3+repack0/hplip.conf.in 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/hplip.conf.in 2016-05-06 12:28:03.000000000 +0000 @@ -40,6 +40,7 @@ ui-toolkit=@ui_toolkit@ qt3=@qt3@ qt4=@qt4@ +qt5=@qt5@ policy-kit=@policykit@ lite-build=@lite_build@ udev_sysfs_rules=@udev_sysfs_rules@ diff -Nru hplip-3.16.3+repack0/info.py hplip-3.16.5+repack0/info.py --- hplip-3.16.3+repack0/info.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/info.py 2016-05-06 12:28:03.000000000 +0000 @@ -31,12 +31,21 @@ import time import os + + # Local from base.g import * from base import device, status, utils, tui, module from prnt import cups try: + from importlib import import_module +except ImportError as e: + log.debug(e) + from base.utils import dyn_import_mod as import_module + + +try: restrict = True devid_mode = '--id' in sys.argv # hack @@ -45,7 +54,7 @@ mod = module.Module(__mod__, __title__, __version__, __doc__, None, - (INTERACTIVE_MODE, GUI_MODE), (UI_TOOLKIT_QT4,), + (INTERACTIVE_MODE, GUI_MODE), (UI_TOOLKIT_QT4, UI_TOOLKIT_QT5), False, devid_mode) mod.setUsage(module.USAGE_FLAG_DEVICE_ARGS, @@ -162,16 +171,12 @@ d.close() else: # GUI mode - try: - from PyQt4.QtGui import QApplication - from ui4.infodialog import InfoDialog - except ImportError: - log.error("Unable to load Qt4 support. Is it installed?") - sys.exit(1) + QApplication, ui_package = utils.import_dialog(ui_toolkit) + ui = import_module(ui_package + ".infodialog") if 1: app = QApplication(sys.argv) - dlg = InfoDialog(None, device_uri) + dlg = ui.InfoDialog(None, device_uri) dlg.show() try: log.debug("Starting GUI loop...") diff -Nru hplip-3.16.3+repack0/installer/core_install.py hplip-3.16.5+repack0/installer/core_install.py --- hplip-3.16.3+repack0/installer/core_install.py 2016-03-19 10:34:19.000000000 +0000 +++ hplip-3.16.5+repack0/installer/core_install.py 2016-05-06 12:28:03.000000000 +0000 @@ -174,6 +174,8 @@ PYNTF_STR = "Python libnotify - Python bindings for the libnotify Desktop notifications" QT4DBUS_STR = "PyQt 4 DBus - DBus Support for PyQt4" QT4_STR = "PyQt 4- Qt interface for Python (for Qt version 4.x)" +QT5DBUS_STR = "PyQt 5 DBus - DBus Support for PyQt5" +QT5_STR = "PyQt 5- Qt interface for Python (for Qt version 4.x)" PYDBUS_STR = "Python DBus - Python bindings for DBus" PYXML_STR = "Python XML libraries" PY_DEV_STR = "Python devel - Python development files" @@ -215,7 +217,8 @@ class CoreInstall(object): - def __init__(self, mode=MODE_INSTALLER, ui_mode=INTERACTIVE_MODE, ui_toolkit='qt4'): + def __init__(self, mode=MODE_INSTALLER, ui_mode=INTERACTIVE_MODE, + ui_toolkit='qt4'): os.umask(0o022) self.mode = mode self.ui_mode = ui_mode @@ -289,7 +292,7 @@ # 'name': ('description', [