hook-_tkinter.py 1.2 KB

12345678910111213141516171819202122
  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.utils.hooks.tcl_tk import tcltk_info
  12. def hook(hook_api):
  13. # Add all Tcl/Tk data files, based on the `TclTkInfo.data_files`. If Tcl/Tk is unavailable, the list is empty.
  14. #
  15. # NOTE: the list contains 3-element TOC tuples with full destination filenames (because other parts of code,
  16. # specifically splash-screen writer, currently require this format). Therefore, we need to use
  17. # `PostGraphAPI.add_datas` (which supports 3-element TOC tuples); if this was 2-element "hook-style" TOC list,
  18. # we could just assign `datas` global hook variable, without implementing the post-graph `hook()` function.
  19. hook_api.add_datas(tcltk_info.data_files)