hplip-ui-optional.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. diff -up hplip-3.16.7/base/utils.py.ui-optional hplip-3.16.7/base/utils.py
  2. --- hplip-3.16.7/base/utils.py.ui-optional 2016-07-15 12:12:28.000000000 +0200
  3. +++ hplip-3.16.7/base/utils.py 2016-08-12 10:12:24.599398769 +0200
  4. @@ -733,6 +733,13 @@ def checkPyQtImport(): # qt3
  5. if os.getenv('DISPLAY') and os.getenv('STARTED_FROM_MENU'):
  6. no_qt_message_gtk()
  7. + # hplip-gui sub-package (Fedora)
  8. + try:
  9. + import ui
  10. + except ImportError:
  11. + log.error("hplip-gui not installed. GUI not available. Exiting.")
  12. + return False
  13. +
  14. log.error("PyQt not installed. GUI not available. Exiting.")
  15. return False
  16. @@ -783,7 +790,8 @@ def checkPyQtImport4():
  17. import PyQt5
  18. import ui5
  19. else:
  20. - log.debug("HPLIP is not installed properly or is installed without graphical support. Please reinstall HPLIP again")
  21. + # hplip-gui sub-package (Fedora) requires python3-qt5
  22. + log.error("Install the hplip-gui package for graphical support.")
  23. return False
  24. return True
  25. @@ -2434,6 +2442,7 @@ def checkPyQtImport45():
  26. except ImportError as e:
  27. log.debug(e)
  28. + log.error("Install the hplip-gui package for graphical support.")
  29. raise ImportError("GUI Modules PyQt4 and PyQt5 are not installed")
  30. @@ -2455,6 +2464,7 @@ def import_dialog(ui_toolkit):
  31. return (QApplication, "ui4")
  32. except ImportError as e:
  33. log.error(e)
  34. + log.error("Unable to load Qt support. Is hplip-gui package installed?")
  35. sys.exit(1)
  36. elif ui_toolkit == "qt5":
  37. try:
  38. @@ -2463,9 +2473,7 @@ def import_dialog(ui_toolkit):
  39. return (QApplication, "ui5")
  40. except ImportError as e:
  41. log.error(e)
  42. - sys.exit(1)
  43. - else:
  44. - log.error("Unable to load Qt support. Is it installed?")
  45. + log.error("Unable to load Qt support. Is hplip-gui package installed?")
  46. sys.exit(1)