mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-27 11:58:53 -06:00
refactor: count nouns through core.text
This commit is contained in:
1 parent
4585e3ffea
commit
77ba6868a0
7 files changed
+60
-28
No files matched your search
@@ -11,6 +11,7 @@ from model import siteinputs
|
||||
from sitegen import markup
|
||||
from core.memo import DerivedView
|
||||
from core.paths import REPO_ROOT
|
||||
from core.text import count_text as count_text
|
||||
from model.collection import PROGRAM_TOPS, card_moves, manufacturer_slug
|
||||
from model.systemnames import (
|
||||
SYSTEM_PARENTS,
|
||||
@@ -59,11 +60,6 @@ def card_anchor(sha1: str) -> str:
|
||||
return f"sha1-{sha1[:SHORT_HASH]}"
|
||||
|
||||
|
||||
def count_text(number: int, noun: str, plural: str = "") -> str:
|
||||
"""A count and its noun, singular for one: the site printed "1 files" 234 times."""
|
||||
return f"{number:,} {noun if number == 1 else plural or noun + 's'}"
|
||||
|
||||
|
||||
def escape_tags(text: str) -> str:
|
||||
"""Show a placeholder such as ``<system_dir>`` as it was written.
|
||||
|
||||
|
||||
Reference in new issue
Block a user