pyi_rth_gtk.py 886 B

123456789101112131415161718192021222324252627
  1. #-----------------------------------------------------------------------------
  2. # Copyright (c) 2015-2023, PyInstaller Development Team.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. #
  7. # The full license is in the file COPYING.txt, distributed with this software.
  8. #
  9. # SPDX-License-Identifier: Apache-2.0
  10. #-----------------------------------------------------------------------------
  11. def _pyi_rthook():
  12. import os
  13. import sys
  14. os.environ['GTK_DATA_PREFIX'] = sys._MEIPASS
  15. os.environ['GTK_EXE_PREFIX'] = sys._MEIPASS
  16. os.environ['GTK_PATH'] = sys._MEIPASS
  17. # Include these here, as GTK will import pango automatically.
  18. os.environ['PANGO_LIBDIR'] = sys._MEIPASS
  19. os.environ['PANGO_SYSCONFDIR'] = os.path.join(sys._MEIPASS, 'etc') # TODO?
  20. _pyi_rthook()
  21. del _pyi_rthook