rpynx v0.1.0pre-release

Importer

Command line

Report on a game, export it to an SD card or upload it to the Switch, from a terminal.

Host-tested25 unit testsSource docs/IMPORTER.md
On this page

importer/rsl_import.py needs Python 3.9+ and nothing else. On macOS, the system /usr/bin/python3 works.

Usage

Report only:

bash
python3 importer/rsl_import.py SOURCE

Report and export to an SD card (macOS, then Windows):

bash
python3 importer/rsl_import.py SOURCE --out /Volumes/SD
powershell
py importer\rsl_import.py SOURCE --out E:\

Report and upload to the Switch over FTP:

bash
python3 importer/rsl_import.py SOURCE --out ftp://192.168.1.20:5000

SOURCE is a game folder (the distribution root, an SDK project, or the game/ folder itself), or a .zip, .7z or .rar file. Every option is listed in Importer CLI options.

Exit status

CodeMeaning
0OK
1Refused: an unsafe archive, not a Ren’Py game, an unsupported game, or the export already exists
2Bad arguments

What gets exported

Only the game directory is copied, and it is always named game/ in the export:

text
switch/renpy-loader/games/<id>/
├── game/
├── manifest.json
├── cover.jpg       when the importer could make one
└── backdrop.jpg

Not copied: renpy/, lib/ and the .exe/.app/.sh launchers (the runtime has its own engine), game/saves/ (the developer’s local saves), symlinks, .DS_Store, ._* and __MACOSX.

Updating a game

Without --replace, the importer refuses when games/<id> exists. With it:

  • the new game/ is staged next to the export and swapped in by rename;
  • an existing game/saves/ is moved into the new game/;
  • a cover or background chosen earlier is kept, unless this export chooses one too;
  • switch/renpy-loader/saves/ is never touched.

Game id and title

  • Title: config.name from game/options.rpy; if missing, the folder or archive name.
  • Id: made from the title, or from the folder name if the title has no ASCII letters or digits. It is lowercased; a-z and 0-9 are kept, every other run of characters becomes one -; it is capped at 63 characters (the loader skips folder names of 64 bytes or more). If nothing is left, it becomes game.
TitleId
The Questionthe-question
ドキドキgame

The id is the folder name, and so also the save and log folder name. If two games end up with the same id, use --id for the second one.

Tools it looks for

7z, ffprobe and ffmpeg are searched for in this order:

  1. the --tools folder;
  2. PATH (on Windows, with .exe added);
  3. /opt/homebrew/bin, /usr/local/bin and C:\Program Files\7-Zip. An app started from the macOS Finder only gets /usr/bin:/bin:/usr/sbin:/sbin as PATH, so Homebrew tools are found through these.
MissingEffect
7-ZipOnly .7z and .rar files cannot be read.
ffprobeVideos are left unchecked, with a warning.
ffmpeg--optimize copies videos unchanged and says so; no cover or background is made.

↑↓ move↵ openesc close