1794147 - HP-setup crashes with Python3 ui5 module not found error
This commit is contained in:
parent
a7ca817248
commit
d6b7a484d5
@ -1,13 +1,21 @@
|
|||||||
diff -up hplip-3.19.6/base/utils.py.ui-optional hplip-3.19.6/base/utils.py
|
diff --git a/base/utils.py b/base/utils.py
|
||||||
--- hplip-3.19.6/base/utils.py.ui-optional 2019-06-26 15:07:10.000000000 +0200
|
index 98437a3..4192189 100644
|
||||||
+++ hplip-3.19.6/base/utils.py 2019-07-12 08:16:22.390256936 +0200
|
--- a/base/utils.py
|
||||||
@@ -1,4 +1,4 @@
|
+++ b/base/utils.py
|
||||||
-#!/usr/bin/env python
|
@@ -722,6 +722,12 @@ def canEnterGUIMode4(): # qt4
|
||||||
+#!/usr/bin/python3
|
log.warn(e)
|
||||||
# -*- coding: utf-8 -*-
|
return False
|
||||||
#
|
|
||||||
# (c) Copyright 2001-2018 HP Development Company, L.P.
|
+ try:
|
||||||
@@ -734,6 +734,13 @@ def checkPyQtImport(): # qt3
|
+ import ui
|
||||||
|
+ except ImportError:
|
||||||
|
+ log.error('HPLIP UI module not installed - run the command with \'-i\' option for interactive mode or install hplip-gui package.')
|
||||||
|
+ return False
|
||||||
|
+
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
@@ -734,6 +740,13 @@ def checkPyQtImport(): # qt3
|
||||||
if os.getenv('DISPLAY') and os.getenv('STARTED_FROM_MENU'):
|
if os.getenv('DISPLAY') and os.getenv('STARTED_FROM_MENU'):
|
||||||
no_qt_message_gtk()
|
no_qt_message_gtk()
|
||||||
|
|
||||||
@ -21,7 +29,7 @@ diff -up hplip-3.19.6/base/utils.py.ui-optional hplip-3.19.6/base/utils.py
|
|||||||
log.error("PyQt not installed. GUI not available. Exiting.")
|
log.error("PyQt not installed. GUI not available. Exiting.")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -784,7 +791,8 @@ def checkPyQtImport4():
|
@@ -784,7 +797,8 @@ def checkPyQtImport4():
|
||||||
import PyQt5
|
import PyQt5
|
||||||
import ui5
|
import ui5
|
||||||
else:
|
else:
|
||||||
@ -31,7 +39,7 @@ diff -up hplip-3.19.6/base/utils.py.ui-optional hplip-3.19.6/base/utils.py
|
|||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@@ -2456,6 +2464,7 @@ def checkPyQtImport45():
|
@@ -2456,6 +2470,7 @@ def checkPyQtImport45():
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
log.debug(e)
|
log.debug(e)
|
||||||
|
|
||||||
@ -39,7 +47,7 @@ diff -up hplip-3.19.6/base/utils.py.ui-optional hplip-3.19.6/base/utils.py
|
|||||||
raise ImportError("GUI Modules PyQt4 and PyQt5 are not installed")
|
raise ImportError("GUI Modules PyQt4 and PyQt5 are not installed")
|
||||||
|
|
||||||
|
|
||||||
@@ -2477,6 +2486,7 @@ def import_dialog(ui_toolkit):
|
@@ -2477,6 +2492,7 @@ def import_dialog(ui_toolkit):
|
||||||
return (QApplication, "ui4")
|
return (QApplication, "ui4")
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
log.error(e)
|
log.error(e)
|
||||||
@ -47,7 +55,7 @@ diff -up hplip-3.19.6/base/utils.py.ui-optional hplip-3.19.6/base/utils.py
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
elif ui_toolkit == "qt5":
|
elif ui_toolkit == "qt5":
|
||||||
try:
|
try:
|
||||||
@@ -2485,9 +2495,7 @@ def import_dialog(ui_toolkit):
|
@@ -2485,9 +2501,7 @@ def import_dialog(ui_toolkit):
|
||||||
return (QApplication, "ui5")
|
return (QApplication, "ui5")
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
log.error(e)
|
log.error(e)
|
||||||
@ -58,9 +66,10 @@ diff -up hplip-3.19.6/base/utils.py.ui-optional hplip-3.19.6/base/utils.py
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
diff -up hplip-3.19.6/plugin.py.ui-optional hplip-3.19.6/plugin.py
|
diff --git a/plugin.py b/plugin.py
|
||||||
--- hplip-3.19.6/plugin.py.ui-optional 2019-06-26 15:07:10.000000000 +0200
|
index c833c55..74f93ef 100755
|
||||||
+++ hplip-3.19.6/plugin.py 2019-07-12 08:15:03.731933177 +0200
|
--- a/plugin.py
|
||||||
|
+++ b/plugin.py
|
||||||
@@ -252,7 +252,11 @@ if mode == GUI_MODE:
|
@@ -252,7 +252,11 @@ if mode == GUI_MODE:
|
||||||
# clean_exit(1)
|
# clean_exit(1)
|
||||||
|
|
||||||
@ -74,3 +83,21 @@ diff -up hplip-3.19.6/plugin.py.ui-optional hplip-3.19.6/plugin.py
|
|||||||
if ui_toolkit == "qt5":
|
if ui_toolkit == "qt5":
|
||||||
from PyQt5.QtWidgets import QMessageBox
|
from PyQt5.QtWidgets import QMessageBox
|
||||||
elif ui_toolkit == "qt4":
|
elif ui_toolkit == "qt4":
|
||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
index ba1b519..ac4afa2 100755
|
||||||
|
--- a/setup.py
|
||||||
|
+++ b/setup.py
|
||||||
|
@@ -218,11 +218,11 @@ if mode == GUI_MODE:
|
||||||
|
log.warning("-p or -f option is not supported")
|
||||||
|
if ui_toolkit == 'qt3':
|
||||||
|
if not utils.canEnterGUIMode():
|
||||||
|
- log.error("%s requires GUI support (try running with --qt4). Also, try using interactive (-i) mode." % __mod__)
|
||||||
|
+ log.error("%s requires GUI support (try running with --qt3). Also, try using interactive (-i) mode." % __mod__)
|
||||||
|
clean_exit(1)
|
||||||
|
else:
|
||||||
|
if not utils.canEnterGUIMode4():
|
||||||
|
- log.error("%s requires GUI support (try running with --qt3). Also, try using interactive (-i) mode." % __mod__)
|
||||||
|
+ log.error("%s requires GUI support (try running with --qt4). Also, try using interactive (-i) mode." % __mod__)
|
||||||
|
clean_exit(1)
|
||||||
|
|
||||||
|
if mode == GUI_MODE:
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
Summary: HP Linux Imaging and Printing Project
|
Summary: HP Linux Imaging and Printing Project
|
||||||
Name: hplip
|
Name: hplip
|
||||||
Version: 3.20.5
|
Version: 3.20.5
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
License: GPLv2+ and MIT and BSD and IJG and Public Domain and GPLv2+ with exceptions and ISC
|
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
|
Url: https://developers.hp.com/hp-linux-imaging-and-printing
|
||||||
@ -702,6 +702,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
|
|||||||
%config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio
|
%config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jun 01 2020 Zdenek Dohnal <zdohnal@redhat.com> - 3.20.5-4
|
||||||
|
- 1794147 - HP-setup crashes with Python3 ui5 module not found error
|
||||||
|
|
||||||
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 3.20.5-3
|
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 3.20.5-3
|
||||||
- Rebuilt for Python 3.9
|
- Rebuilt for Python 3.9
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user