fix: restore collect_all for mysql.connector to fix no localization for language eng
This commit is contained in:
@@ -1,31 +1,21 @@
|
|||||||
# -*- mode: python ; coding: utf-8 -*-
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
import os
|
from PyInstaller.utils.hooks import collect_all
|
||||||
|
|
||||||
# Bundle mysql-connector locales to fix "no localization for language 'eng'" error
|
mysql_datas, mysql_binaries, mysql_hiddenimports = collect_all('mysql.connector')
|
||||||
_mysql_locales = os.path.join(
|
|
||||||
os.path.dirname(os.path.abspath('.')),
|
|
||||||
'db_interface', 'venv', 'Lib', 'site-packages', 'mysql', 'connector', 'locales'
|
|
||||||
)
|
|
||||||
# Fallback: resolve relative to spec file location
|
|
||||||
_spec_dir = os.path.dirname(os.path.abspath(SPEC))
|
|
||||||
_mysql_locales = os.path.join(_spec_dir, 'venv', 'Lib', 'site-packages', 'mysql', 'connector', 'locales')
|
|
||||||
|
|
||||||
a = Analysis(
|
a = Analysis(
|
||||||
['main.py'],
|
['main.py'],
|
||||||
pathex=[],
|
pathex=[],
|
||||||
binaries=[],
|
binaries=mysql_binaries,
|
||||||
datas=[
|
datas=mysql_datas,
|
||||||
(_mysql_locales, os.path.join('mysql', 'connector', 'locales')),
|
hiddenimports=mysql_hiddenimports + [
|
||||||
],
|
'mysql', 'mysql.connector', 'mysql.connector.locales',
|
||||||
hiddenimports=[
|
'mysql.connector.locales.eng', 'mysql.connector.locales.eng.client_error',
|
||||||
'mysql.connector',
|
'mysql.connector.plugins', 'mysql.connector.plugins.mysql_native_password',
|
||||||
'mysql.connector.locales',
|
|
||||||
'mysql.connector.locales.eng',
|
|
||||||
'mysql.connector.plugins',
|
|
||||||
'mysql.connector.plugins.mysql_native_password',
|
|
||||||
'mysql.connector.plugins.caching_sha2_password',
|
'mysql.connector.plugins.caching_sha2_password',
|
||||||
'kivy.core.window.window_sdl2',
|
'mysql.connector.aio', 'mysql.connector.aio.plugins',
|
||||||
'win32timezone',
|
'mysql.connector.aio.plugins.mysql_native_password',
|
||||||
|
'kivy.core.window.window_sdl2', 'win32timezone',
|
||||||
],
|
],
|
||||||
hookspath=[],
|
hookspath=[],
|
||||||
hooksconfig={},
|
hooksconfig={},
|
||||||
|
|||||||
BIN
dist/DatabaseApp.exe
vendored
BIN
dist/DatabaseApp.exe
vendored
Binary file not shown.
Reference in New Issue
Block a user