hook-pyshark.py 894 B

12345678910111213141516171819202122232425
  1. # ------------------------------------------------------------------
  2. # Copyright (c) 2021 PyInstaller Development Team.
  3. #
  4. # This file is distributed under the terms of the GNU General Public
  5. # License (version 2.0 or later).
  6. #
  7. # The full license is available in LICENSE, distributed with
  8. # this software.
  9. #
  10. # SPDX-License-Identifier: GPL-2.0-or-later
  11. # ------------------------------------------------------------------
  12. # Python wrapper for pyshark(https://pypi.org/project/pyshark/)
  13. # Tested with version 0.4.5
  14. from PyInstaller.utils.hooks import collect_data_files, is_module_satisfies
  15. hiddenimports = ['pyshark.config']
  16. if is_module_satisfies("pyshark < 0.6"):
  17. hiddenimports += ['py._path.local', 'py._vendored_packages.iniconfig']
  18. if is_module_satisfies("pyshark >= 0.5"):
  19. hiddenimports += ["py._io.terminalwriter", "py._builtin"]
  20. datas = collect_data_files('pyshark')