Provisions-Manager 95: Import, Händler-DB, Auszahlungsregeln, Excel-Export, Win95-Oberfläche, Wine-Build
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
da2e3c9ba1
25 files changed
+3366
No files matched your search
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
# Baut die Windows-.exe mit Windows-Python unter Wine (z. B. im Container tobix/pywine:3.12).
|
||||
# Ergebnis: dist/Provisionsmanager95.exe und dist/Provisionsmanager95-<version>.zip
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
export WINEDEBUG=-all
|
||||
export LANG=C.UTF-8 LC_ALL=C.UTF-8 # sonst kann Wine keine Umlaute in Dateinamen abbilden
|
||||
export WINEPREFIX="${WINEPREFIX:-/opt/wineprefix}"
|
||||
PY="wine python"
|
||||
|
||||
$PY --version
|
||||
$PY -m pip install --disable-pip-version-check -q -r requirements-dev.txt
|
||||
|
||||
echo "== Tests (Windows-Python) =="
|
||||
$PY -m pytest -q
|
||||
|
||||
echo "== Version =="
|
||||
VERSION=$($PY build/version_info.py | tr -d '\r')
|
||||
echo "Version $VERSION"
|
||||
|
||||
echo "== PyInstaller =="
|
||||
$PY -m PyInstaller --noconfirm --clean --distpath dist --workpath build/tmp build/provisionsmanager.spec
|
||||
|
||||
test -f dist/Provisionsmanager95.exe
|
||||
cp README.md dist/LIESMICH.md 2>/dev/null || true
|
||||
( cd dist && rm -f Provisionsmanager95-*.zip && \
|
||||
python3 -c "import zipfile,sys; z=zipfile.ZipFile(sys.argv[1],'w',zipfile.ZIP_DEFLATED); [z.write(f) for f in sys.argv[2:]]; z.close()" \
|
||||
"Provisionsmanager95-${VERSION}.zip" Provisionsmanager95.exe LIESMICH.md 2>/dev/null \
|
||||
|| $PY -c "import zipfile,sys; z=zipfile.ZipFile(sys.argv[1],'w',zipfile.ZIP_DEFLATED); [z.write(f) for f in sys.argv[2:]]; z.close()" \
|
||||
"Provisionsmanager95-${VERSION}.zip" Provisionsmanager95.exe LIESMICH.md )
|
||||
echo "$VERSION" > dist/VERSION
|
||||
ls -la dist
|
||||
@@ -0,0 +1,20 @@
|
||||
"""Erzeugt assets/app.ico aus der Pixel-Grafik in provtool/gui/win95.py (benötigt Pillow, nur zum Entwickeln)."""
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from PIL import Image
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT))
|
||||
from provtool.gui.win95 import PALETTE, _icon_rows # noqa: E402
|
||||
|
||||
img = Image.new("RGBA", (16, 16), (0, 0, 0, 0))
|
||||
for y, row in enumerate(_icon_rows("app")):
|
||||
for x, ch in enumerate(row):
|
||||
if ch != ".":
|
||||
img.putpixel((x, y), tuple(int(PALETTE[ch][i:i + 2], 16) for i in (1, 3, 5)) + (255,))
|
||||
groessen = [16, 32, 48, 64, 128, 256]
|
||||
big = img.resize((256, 256), Image.NEAREST)
|
||||
big.save(ROOT / "assets" / "app.ico", sizes=[(s, s) for s in groessen])
|
||||
big.save(ROOT / "assets" / "app.png")
|
||||
print("assets/app.ico geschrieben")
|
||||
@@ -0,0 +1,29 @@
|
||||
# PyInstaller-Spezifikation – erzeugt eine einzelne Provisionsmanager95.exe
|
||||
# Aufruf (unter Windows oder Wine): pyinstaller --noconfirm build/provisionsmanager.spec
|
||||
import os
|
||||
|
||||
ROOT = os.path.abspath(os.path.join(SPECPATH, ".."))
|
||||
|
||||
a = Analysis(
|
||||
[os.path.join(ROOT, "build", "start.py")],
|
||||
pathex=[ROOT],
|
||||
hiddenimports=["openpyxl", "xlrd"],
|
||||
excludes=["numpy", "pandas", "PIL", "pytest", "matplotlib", "unittest", "pydoc_data"],
|
||||
noarchive=False,
|
||||
)
|
||||
pyz = PYZ(a.pure)
|
||||
exe = EXE(
|
||||
pyz,
|
||||
a.scripts,
|
||||
a.binaries,
|
||||
a.datas,
|
||||
[],
|
||||
name="Provisionsmanager95",
|
||||
icon=os.path.join(ROOT, "assets", "app.ico"),
|
||||
version=os.path.join(ROOT, "build", "version_info.txt"),
|
||||
console=False,
|
||||
upx=False,
|
||||
debug=False,
|
||||
strip=False,
|
||||
runtime_tmpdir=None,
|
||||
)
|
||||
@@ -0,0 +1,3 @@
|
||||
from provtool.gui.app import main
|
||||
|
||||
main()
|
||||
@@ -0,0 +1,26 @@
|
||||
"""Schreibt build/version_info.txt (Windows-Dateieigenschaften der .exe) aus provtool.__version__."""
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT))
|
||||
from provtool import APP_NAME, APP_ORG, __version__ # noqa: E402
|
||||
|
||||
v = tuple(int(x) for x in (__version__.split(".") + ["0", "0", "0"])[:4])
|
||||
text = f"""VSVersionInfo(
|
||||
ffi=FixedFileInfo(filevers={v}, prodvers={v}, mask=0x3f, flags=0x0, OS=0x40004, fileType=0x1, subtype=0x0),
|
||||
kids=[
|
||||
StringFileInfo([StringTable('040704b0', [
|
||||
StringStruct('CompanyName', '{APP_ORG}'),
|
||||
StringStruct('FileDescription', '{APP_NAME}'),
|
||||
StringStruct('FileVersion', '{__version__}'),
|
||||
StringStruct('InternalName', 'Provisionsmanager95'),
|
||||
StringStruct('OriginalFilename', 'Provisionsmanager95.exe'),
|
||||
StringStruct('ProductName', '{APP_NAME}'),
|
||||
StringStruct('ProductVersion', '{__version__}')])]),
|
||||
VarFileInfo([VarStruct('Translation', [0x0407, 1200])])
|
||||
]
|
||||
)
|
||||
"""
|
||||
(ROOT / "build" / "version_info.txt").write_text(text, encoding="utf-8")
|
||||
print(__version__)
|
||||
Reference in new issue
Block a user