fix: dynamic height layout + bundle mysql locales to fix 'no localization for eng' error\n\n- Replace all fixed pixel heights in content_layout with size_hint_y proportions\n so the 6 rows fill available space on any screen (800p, 1080p, etc.)\n- Remove AnchorLayout wrapper that caused dead space above content\n- Bundle mysql/connector/locales in PyInstaller build (spec + build_windows.py)\n- Add mysql.connector.plugins hidden imports to spec and build script"

This commit is contained in:
2026-04-07 16:52:10 +03:00
parent b51e8bcc2a
commit 0f7e157406
4 changed files with 78 additions and 83 deletions

View File

@@ -1,21 +1,31 @@
# -*- mode: python ; coding: utf-8 -*-
from PyInstaller.utils.hooks import collect_all
import os
mysql_datas, mysql_binaries, mysql_hiddenimports = collect_all('mysql.connector')
# Bundle mysql-connector locales to fix "no localization for language 'eng'" error
_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(
['main.py'],
pathex=[],
binaries=mysql_binaries,
datas=mysql_datas,
hiddenimports=mysql_hiddenimports + [
'mysql', 'mysql.connector', 'mysql.connector.locales',
'mysql.connector.locales.eng', 'mysql.connector.locales.eng.client_error',
'mysql.connector.plugins', 'mysql.connector.plugins.mysql_native_password',
binaries=[],
datas=[
(_mysql_locales, os.path.join('mysql', 'connector', 'locales')),
],
hiddenimports=[
'mysql.connector',
'mysql.connector.locales',
'mysql.connector.locales.eng',
'mysql.connector.plugins',
'mysql.connector.plugins.mysql_native_password',
'mysql.connector.plugins.caching_sha2_password',
'mysql.connector.aio', 'mysql.connector.aio.plugins',
'mysql.connector.aio.plugins.mysql_native_password',
'kivy.core.window.window_sdl2', 'win32timezone',
'kivy.core.window.window_sdl2',
'win32timezone',
],
hookspath=[],
hooksconfig={},