diff --git a/hplip-ui-optional.patch b/hplip-ui-optional.patch index 2699d1e..08e6d12 100644 --- a/hplip-ui-optional.patch +++ b/hplip-ui-optional.patch @@ -118,25 +118,6 @@ index 3d41f04..0141f23 100755 #try: if 1: -diff --git a/devicesettings.py b/devicesettings.py -index 0710519..ac42db5 100755 ---- a/devicesettings.py -+++ b/devicesettings.py -@@ -75,7 +75,13 @@ try: - # 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") -+ -+ try: -+ ui = import_module(ui_package + ".devicesetupdialog") -+ except ModuleNotFoundError: -+ log.error('HPLIP GUI is not available - use interactive mode ' -+ '(option \'-i\') or install hplip-gui package.') -+ sys.exit(1) - - app = QApplication(sys.argv) - dlg = ui.DeviceSetupDialog(None, device_uri) diff --git a/diagnose_plugin.py b/diagnose_plugin.py index e4e6ebd..1bcd8c3 100755 --- a/diagnose_plugin.py @@ -176,25 +157,6 @@ index 9bd6166..e11ebc4 100755 log.set_module("hp-fab(qt4)") -diff --git a/faxsetup.py b/faxsetup.py -index dd704d2..b8b3e6e 100755 ---- a/faxsetup.py -+++ b/faxsetup.py -@@ -73,7 +73,13 @@ try: - # 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") -+ -+ try: -+ ui = import_module(ui_package + ".faxsetupdialog") -+ except ModuleNotFoundError: -+ log.error('HPLIP GUI is not available - use interactive mode ' -+ '(option \'-i\') or install hplip-gui package.') -+ sys.exit(1) - - app = QApplication(sys.argv) - dlg = ui.FaxSetupDialog(None, device_uri) diff --git a/firmware.py b/firmware.py index 33e044d..a38058b 100755 --- a/firmware.py @@ -253,42 +215,6 @@ index f54f726..58d6006 100755 if ui_toolkit == "qt5": from PyQt5.QtWidgets import QMessageBox elif ui_toolkit == "qt4": -diff --git a/print.py b/print.py -index ab37047..f98e5bd 100755 ---- a/print.py -+++ b/print.py -@@ -140,7 +140,12 @@ else: # qt4 - # 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 + ".printdialog") -+ try: -+ ui = import_module(ui_package + ".printdialog") -+ except ModuleNotFoundError: -+ log.error('HPLIP GUI is not available - use interactive mode ' -+ '(option \'-i\') or install hplip-gui package.') -+ sys.exit(1) - - if 1: - app = QApplication(sys.argv) -diff --git a/printsettings.py b/printsettings.py -index 76b662e..7a1b416 100755 ---- a/printsettings.py -+++ b/printsettings.py -@@ -85,7 +85,12 @@ try: - # 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 + ".printsettingsdialog") -+ try: -+ ui = import_module(ui_package + ".printsettingsdialog") -+ except ModuleNotFoundError: -+ log.error('HPLIP GUI is not available - use interactive mode ' -+ '(option \'-i\') or install hplip-gui package.') -+ sys.exit(1) - - app = QApplication(sys.argv) - dialog = ui.PrintSettingsDialog(None, printer_name, fax_mode) diff --git a/sendfax.py b/sendfax.py index 491c8f9..0815ee7 100755 --- a/sendfax.py @@ -345,61 +271,3 @@ index a5ed2bc..2a707a1 100755 log.set_module("%s(UI)" % __mod__) -diff --git a/toolbox.py b/toolbox.py -index 2a67504..4e57b9e 100755 ---- a/toolbox.py -+++ b/toolbox.py -@@ -267,9 +267,13 @@ else: # qt4 - # log.error("Unable to load Qt support") - # sys.exit(1) - QApplication, ui_package = utils.import_dialog(ui_toolkit) -- ui = import_module(ui_package + ".devmgr5") -- - -+ try: -+ ui = import_module(ui_package + ".devmgr5") -+ except ModuleNotFoundError: -+ log.error('HPLIP GUI is not available - use interactive mode ' -+ '(option \'-i\') or install hplip-gui package.') -+ sys.exit(1) - - log.set_module("hp-toolbox(UI)") - -diff --git a/uiscan.py b/uiscan.py -index 6301c1f..9f42c52 100755 ---- a/uiscan.py -+++ b/uiscan.py -@@ -55,7 +55,13 @@ if __name__ == "__main__": - - QApplication, ui_package = utils.import_dialog(ui_toolkit) - -- ui = import_module(ui_package + ".scandialog") -+ -+ try: -+ ui = import_module(ui_package + ".scandialog") -+ except ModuleNotFoundError: -+ log.error('HPLIP GUI is not available - use interactive mode ' -+ '(option \'-i\') or install hplip-gui package.') -+ sys.exit(1) - - obj=ui.SetupDialog() - #obk=obj.setupUi(devicelist) -diff --git a/wificonfig.py b/wificonfig.py -index b21e83a..21b11c7 100755 ---- a/wificonfig.py -+++ b/wificonfig.py -@@ -72,7 +72,13 @@ try: - # sys.exit(1) - - QApplication, ui_package = utils.import_dialog(ui_toolkit) -- ui = import_module(ui_package + ".wifisetupdialog") -+ -+ try: -+ ui = import_module(ui_package + ".wifisetupdialog") -+ except ModuleNotFoundError: -+ log.error('HPLIP GUI is not available - use interactive mode ' -+ '(option \'-i\') or install hplip-gui package.') -+ sys.exit(1) - - app = QApplication(sys.argv) - dlg = ui.WifiSetupDialog(None, device_uri, standalone=True) diff --git a/hplip.spec b/hplip.spec index fbbbdc3..e1bd587 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.20.5 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ and MIT and BSD and IJG and Public Domain and GPLv2+ with exceptions and ISC Url: https://developers.hp.com/hp-linux-imaging-and-printing @@ -720,6 +720,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio %changelog +* Tue Jun 16 2020 Zdenek Dohnal - 3.20.5-6 +- remove the check for scripts which are only in hplip-gui + * Tue Jun 16 2020 Zdenek Dohnal - 3.20.5-5 - fix the optional GUI