Spaces:
Running
Running
ChenyuRabbitLove
commited on
Commit
•
77f112d
1
Parent(s):
5fafe16
refactor: rename achievement log to adventure log
Browse files- utils/utils.py +7 -7
utils/utils.py
CHANGED
@@ -29,15 +29,15 @@ def get_player_badges(player_info: gr.State) -> List[str]:
|
|
29 |
return [f"{MEDIA_PATH}{badge}{MEDIA_FILE_TYPE}" for badge in player_info["badges"]]
|
30 |
|
31 |
|
32 |
-
def
|
33 |
-
log_template = """<div class="
|
34 |
return [
|
35 |
log_template.format(player_log=player_log)
|
36 |
-
for player_log in player_info["
|
37 |
]
|
38 |
|
39 |
|
40 |
-
def
|
41 |
-
|
42 |
-
template_content = get_content("htmls/
|
43 |
-
return template_content.replace("{logs}",
|
|
|
29 |
return [f"{MEDIA_PATH}{badge}{MEDIA_FILE_TYPE}" for badge in player_info["badges"]]
|
30 |
|
31 |
|
32 |
+
def get_player_adventure_logs(player_info: gr.State) -> List[str]:
|
33 |
+
log_template = """<div class="adventure"><p>{player_log}</p></div>"""
|
34 |
return [
|
35 |
log_template.format(player_log=player_log)
|
36 |
+
for player_log in player_info["adventure_logs"]
|
37 |
]
|
38 |
|
39 |
|
40 |
+
def get_player_adventure_logs_html(player_info: gr.State) -> str:
|
41 |
+
adventure_logs = "".join(get_player_adventure_logs(player_info))
|
42 |
+
template_content = get_content("htmls/adventure_template.html")
|
43 |
+
return template_content.replace("{logs}", adventure_logs)
|