hook-PySide2.Qwt5.py 972 B

12345678910111213141516171819202122232425262728293031
  1. #-----------------------------------------------------------------------------
  2. # Copyright (c) 2013-2023, PyInstaller Development Team.
  3. #
  4. # Distributed under the terms of the GNU General Public License (version 2
  5. # or later) with exception for distributing the bootloader.
  6. #
  7. # The full license is in the file COPYING.txt, distributed with this software.
  8. #
  9. # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
  10. #-----------------------------------------------------------------------------
  11. from PyInstaller import isolated
  12. hiddenimports = ['PySide2.QtCore', 'PySide2.QtWidgets', 'PySide2.QtGui', 'PySide2.QtSvg']
  13. @isolated.decorate
  14. def conditional_imports():
  15. from PySide2 import Qwt5
  16. out = []
  17. if hasattr(Qwt5, "toNumpy"):
  18. out.append("numpy")
  19. if hasattr(Qwt5, "toNumeric"):
  20. out.append("numeric")
  21. if hasattr(Qwt5, "toNumarray"):
  22. out.append("numarray")
  23. return out
  24. hiddenimports += conditional_imports()