18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-28 01:07:07 +01:00
Commit Graph

4 Commits

Author SHA1 Message Date
maj00r
827db54430 fix(python): the files a screen opens itself are found on Linux when named in another case (#449)
#362 made the simulator find the data named in another case of its letters, through FileOnDisk(), the
script of a screen included. What the script opens itself goes past it: Image.open(), ImageFont.truetype(),
open() and the openimage() of the screens go straight to the system. The data is made on Windows, so on
Linux a screen that asks for "WS_on.png" where the disk has "ws_on.png" doesn't start at all, e.g. the left
screens of the EN57AL/AKM (WS_gotowosc.png), EN57AKL and EN71AKS (WN_off.png, M1M2_on.png and more).

abstractscreenrenderer.py, run in __main__ before any screen, now finds those files as FileCased() does:
the name given when it's on the disk, otherwise the one differing from it only in case, of the file or of
its folders, a folder listed again for a name missing at most once a second. builtins.open() (which
Image.open() goes through) and ImageFont.truetype() take the name so found, and openimage() looks for it.
A file not there yet goes into its folder as named on the disk, so a screen writing its state for the first
time doesn't make a second folder. A name with no such file is passed on as given, so a file missing fails
as before.

On Windows, which finds the names in any case itself, nothing is wrapped and nothing changes. No change to
the game data is needed.

Checked on a case-sensitive folder (a Windows folder with the case-sensitive attribute) with the scripts as
they are in the data: with the file of master the EN57AL, EN57AKL and EN71AKS screens fail to start, with
this one they start and render; plus the cases of the lookup (folders, ./, .., backslashes, a new file, a
missing one, the module run twice, a screen's global named like the module's own).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 19:28:54 +01:00
pwarszawski
eb75089ba2 Python screens: ship Pillow with the Windows build, and the screen module for Pillow 10+
- The Windows build job installs Pillow into the Python 3.14 whose Lib, with
  site-packages, CMake copies next to the executable as python64\Lib, as the
  Linux job already does; the README says the same for a local build.
- Both build jobs copy staticFiles/python/local (the Python 3 version of the
  module every cab screen subclasses) into python/local of the build.
- The module puts back what Pillow 10 removed and the screen scripts use:
  ImageFont.getsize() and ImageDraw.textsize() on top of getbbox() /
  textbbox(), and Image.ANTIALIAS as LANCZOS. With an older Pillow nothing
  changes.

Part of #300.
2026-11-08 21:12:35 +01:00
maj00r
3786ecd98f Python 3.14 build and CI updates
Squashes the last five commits: migrate to Python 3.14 (CMake, AppVeyor, Azure, README), vcpkg/setup-ci fixes, CMake adjustments, remove bundled ref/python 2.7, and related scripting/static file updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 18:21:12 +02:00
d1d5a94886 Add staticFiles directory
this contains all files which should be shipped with executable
2025-04-15 01:50:48 +02:00