Skip to content

Commit f1e7cf3

Browse files
committed
check-files: add progressbar
1 parent 6ceabee commit f1e7cf3

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

tests/check_files.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,26 @@
55

66
import json
77
import os
8+
import progressbar
9+
810

911
path = "../entries/"
1012
games_list = os.listdir(path)
1113

12-
for game in games_list:
13-
14+
for game in progressbar.progressbar(games_list, redirect_stdout=True):
1415
with open(f"../entries/{game}/game.json") as f:
1516
game = json.load(f)
1617
print(f"Checking {game['slug']}..")
1718
for file in game["files"]:
1819
if file["filename"] not in os.listdir(f"{path}/{game['slug']}"):
19-
raise Exception(f'{file["filename"]} found in manifest but not on disk (entry {game["slug"]})')
20+
raise Exception(
21+
f'{file["filename"]} found in manifest but not on disk (entry {game["slug"]})'
22+
)
2023
for screenshot in game["screenshots"]:
2124
if screenshot not in os.listdir(f"{path}/{game['slug']}"):
22-
raise Exception(f'{screenshot} found in manifest but not on disk (entry {game["slug"]})')
23-
print(f"{game['slug']}: {len(game['files'])} file(s), {len(game['screenshots'])} screenshot(s)")
25+
raise Exception(
26+
f'{screenshot} found in manifest but not on disk (entry {game["slug"]})'
27+
)
28+
print(
29+
f"{game['slug']}: {len(game['files'])} file(s), {len(game['screenshots'])} screenshot(s)"
30+
)

0 commit comments

Comments
 (0)