diff --git a/tests/test_doc_pages.py b/tests/test_doc_pages.py index 025cde83..73d75bfd 100644 --- a/tests/test_doc_pages.py +++ b/tests/test_doc_pages.py @@ -699,13 +699,14 @@ class FirstInstallWalkthrough(unittest.TestCase): step3 = _section(self.run, "The file index and the download") step4 = _section(self.run, "The end of the run") step5 = _section(self.run, "A later check") - # First install names the three endings a run prints, and no count: - # a figure from one setup read as the size of every install. + # First install names the three endings the full screen shows as + # its title, and no count: a figure from one setup read as the size + # of every install. source = (ROOT / "install.py").read_text(encoding="utf-8") - for ending in ("Done.", "Finished with errors.", "Nothing was installed."): + for ending in ("Done", "Finished with errors", "Nothing installed"): with self.subTest(ending=ending): - self.assertIn(f"`{ending}`", _section(self.text, "5. Read the last line")) - self.assertIn(f'"\\n{ending} ', source) + self.assertIn(f"**{ending}**", _section(self.text, "5. Read the result")) + self.assertIn(f'title = "{ending}"', source) self.assertNotRegex(self.text, r"Done\. \d+ files") count, size = re.search(r"\n (\d+) files \(([\d.]+ [KMG]B)\)", step3).groups() self.assertIn(f"0/{count} present", step3) @@ -726,15 +727,17 @@ class FirstInstallWalkthrough(unittest.TestCase): self.assertIn(f"all {required} belong", step4) self.assertIn(f"other {total - required} are optional", step4) - def test_no_platform_detected_reads_like_the_installer(self): - source = (ROOT / "install.py").read_text(encoding="utf-8") - branch = source.split('print(" No supported platform detected.")', 1)[1][:1600] - self.assertIn("if not interactive or listing:", branch) - self.assertIn("_prompt_manual_platform(os_type)", branch) + def test_nothing_found_reads_like_the_installer(self): + # The one-liner hands the terminal to the installer, which opens the + # full screen: its first screen says the heading and offers the row. + import install + self.assertIn('"$INSTALLER" "$@" ", section) self.assertNotIn("Batocera", section) def test_the_diagram_follows_the_steps(self): text = _wiki("first-install.md") - self.assertLess(text.index("## 5. Read the last line"), text.index("")) + self.assertLess(text.index("## 5. Read the result"), text.index("")) class OneNamePerPage(unittest.TestCase): diff --git a/tests/test_site_r3_wiki.py b/tests/test_site_r3_wiki.py index 78970435..3fadac8b 100644 --- a/tests/test_site_r3_wiki.py +++ b/tests/test_site_r3_wiki.py @@ -251,11 +251,21 @@ class SmallCopyFixes(unittest.TestCase): self.assertIn("`retroarch/cores/system/` on the SD card", guides) self.assertIn("--dest E:\\retroarch\\cores\\system", section) - def test_the_end_line_is_the_printed_one(self): - section = _section(_wiki("first-install.md"), "5. Read the last line") - self.assertIn("`N files installed, M already up to date.`", section) - source = (REPO_ROOT / "install.py").read_text(encoding="utf-8") - self.assertIn("installed, \"\n f\"{_plural(up_to_date, 'file')} already up to date.", source) + def test_the_end_is_the_shown_one(self): + # The one-liner opens the full screen: the page names the titles + # its result screen shows, as tui_outcome writes them. + import install + + section = _section(_wiki("first-install.md"), "5. Read the result") + state = install.TuiState() + state.stack, state.code = ["result"], 0 + for summary in ({"installed": 3, "up_to_date": 0, "failed": []}, + {"installed": 2, "failed": [{"dest": "a.bin", "reason": "HTTP 404"}]}, + {"installed": 0, "failed": [{"dest": "a.bin", "reason": "HTTP 404"}]}): + state.summary = summary + title, _lines = install.tui_outcome(state) + with self.subTest(title=title): + self.assertIn(f"**{title}**", section) class CommunityAnswers(unittest.TestCase): diff --git a/wiki/first-install.md b/wiki/first-install.md index 6b461a83..33a97475 100644 --- a/wiki/first-install.md +++ b/wiki/first-install.md @@ -67,44 +67,44 @@ curl -fsSL https://raw.githubusercontent.com/Abdess/retrobios/main/install.sh | On Batocera, Recalbox and similar setups, see [Get your files](../which-pack.md). -## 2. Check the folder it found +## 2. Check the setup it found -It shows your setup and its BIOS folder: +It opens a menu: ``` - Found at + RetroBIOS: Where do you play? + Found on this machine: + > + Another setup or folder + BIOS folder: ``` -- **Right folder?** Go on. -- **Wrong folder?** Press Ctrl+C. Run it again with your folder: +- **Right folder?** Press Enter. +- **Wrong folder?** Choose **Another setup or folder**, then browse to yours. +- **A handheld's SD card in a reader?** It is listed, as **muOS SD card**. - -```sh -curl -fsSL https://raw.githubusercontent.com/Abdess/retrobios/main/install.sh | sh -s -- --dest ~/path/to/bios -``` +Arrows move, Enter chooses, Esc goes back. A controller's A and B do the same. -## 3. Choose what to install +## 3. Install -``` - Enter) install everything - i) only what the installed cores read - c) choose systems, cores and regions - q) quit -``` +The next screen counts the missing files and the free space. +Press Enter on **Install**. **Choose systems** keeps the consoles you +play. -**Enter** installs everything. **c** lets you pick consoles. +**Old card?** In a card reader, choose **Copy the BIOS files from your old +card or a folder**, then the card. It stays unchanged. ## 4. Wait -Ctrl+C stops it. Run the command again to carry on. +B or Ctrl+C stops it. Run it again to carry on. -## 5. Read the last line +## 5. Read the result -- **`Done.`** `N files installed, M already up to date.` All files are in place. -- **`Finished with errors.`** Some files failed. Run the same command again. - It retries only those. -- **`Nothing was installed.`** The lines above it say why. See - [If it stops](#if-it-stops). +- **Done**: all files are in place. +- **Finished with errors**: run the command again. It retries only those. +- **Nothing installed**: the screen says why. See [If it stops](#if-it-stops). + +For questions line by line (screen readers), add `--plain`. ## What the command does @@ -127,18 +127,14 @@ All good: ## Undo -Every file it replaces goes to a `retrobios-backup` folder next to your BIOS -folder. The last lines say how to put them back. +Files it replaces go to a `retrobios-backup` folder beside your BIOS folder. +The result says how to restore them. ## If it stops -### No supported platform detected. +### Nothing was found here. -At a terminal, a menu follows. Pick your setup by its number, then type its -BIOS folder, or press Enter for the usual one. - -With `--no-input`, or without a terminal, it stops and prints the command to -use. +Choose **Another setup or folder**, then your setup and its folder. ### Error: Python 3.8 or newer is required. @@ -157,9 +153,9 @@ The download was cut short. Nothing was changed. Run the command again. You cannot write there. Do what the message says. -### Not enough space on the drive holding ... +### The card is full -Nothing was written. Free some space, or pick another drive with `--dest`. +Nothing was written. Free some space, or choose another folder. ### The game still does not start diff --git a/wiki/troubleshooting.md b/wiki/troubleshooting.md index af29ce2a..deec29fe 100644 --- a/wiki/troubleshooting.md +++ b/wiki/troubleshooting.md @@ -38,7 +38,8 @@ Run it without `--check`. It adds missing files and replaces wrong ones. - **Right folder?** [Get your files](../which-pack.md) names it. - **Exact name?** `scph5501.bin` and `SCPH-5501.BIN` differ. On Linux, capitals count too. -- **A `bios` folder inside your BIOS folder?** Move its files up one level. +- **A `bios` folder inside your BIOS folder?** Run the installer: it copies + those files up one level. - **Unzipped by hand on Linux?** The command adds names that differ by capitals. - **A ZIP in parts, like `Pack.part1of2.zip`?** Unzip every part into one