Compare commits

..

2 commits

Author SHA1 Message Date
f9cb1c9fdb 0.2 2024-05-04 17:03:21 +02:00
c114c2175f Gracefully handle words without audio 2024-05-04 17:02:23 +02:00
2 changed files with 12 additions and 2 deletions

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
klette (0.2) UNRELEASED; urgency=low
* Various improvements.
-- Adrian Heine <debian@adrianheine.de> Sat, 04 May 2024 17:02:00 +0200
klette (0.1) UNRELEASED; urgency=low
* Initial release.

View file

@ -137,14 +137,18 @@ def einzelne_abfrage(palabra, status):
case 2: bien = Resultado.BIEN if resultado < 2 else (Resultado.NO_BIEN if resultado < 3 else Resultado.MAL)
case 3: bien = Resultado.BIEN if resultado < 2 else Resultado.MAL
case 4: bien = Resultado.BIEN if resultado < 1 else Resultado.MAL
print(f" {bcolors.LINK_START}file://{AUDIO_BASE}{palabra['audio']}.aac{bcolors.LINK_MIDDLE}",end="")
if 'audio' in palabra:
print(f" {bcolors.LINK_START}file://{AUDIO_BASE}{palabra['audio']}.aac{bcolors.LINK_MIDDLE}",end="")
else
print(" ",end="")
if bien == Resultado.CORRECTO:
print(f"{bcolors.OKGREEN}{bcolors.ENDC}",end="")
elif bien == Resultado.BIEN:
print(f"{bcolors.WARNING}{palabra['es']}{bcolors.ENDC}",end="")
else:
print(f"{bcolors.FAIL}{palabra['es']}{bcolors.ENDC}",end="")
print(bcolors.LINK_END,end="")
if 'audio' in palabra:
print(bcolors.LINK_END,end="")
try:
if input(" ") == "+":
bien = Resultado.CORRECTO