Fehlende Status-Datei akzeptieren
This commit is contained in:
parent
fcdb73f983
commit
871ace3ba0
1 changed files with 13 additions and 9 deletions
6
main.py
6
main.py
|
|
@ -241,7 +241,7 @@ class Sesion:
|
|||
|
||||
def abfrage(parser, quiero_unidad, otra_vez):
|
||||
random.seed()
|
||||
try:
|
||||
status = {}
|
||||
palabras = []
|
||||
os.makedirs(VOKABELN_DIR, exist_ok=True)
|
||||
try:
|
||||
|
|
@ -252,9 +252,13 @@ def abfrage(parser, quiero_unidad, otra_vez):
|
|||
for filename in glob.glob(os.path.join(VOKABELN_DIR, '*.json')):
|
||||
with open(filename, 'r') as f:
|
||||
palabras += json.load(f)
|
||||
try:
|
||||
with open(STATUS_FILE, 'r') as f:
|
||||
status = json.load(f)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
if len(palabras) == 0:
|
||||
print(f"{bcolors.FAIL}Daten können nicht geladen werden, hast du sie schon importiert?{bcolors.ENDC}")
|
||||
print()
|
||||
parser.print_help()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue