Skip to content

Commit

Permalink
debug stage_list_generator.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dzyxdd committed Feb 20, 2024
1 parent 20bb2bf commit 3d8fb15
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions python_generator/stage_list_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,22 @@

# 读取JSON数据
with open('../docs/music_lib/stage_list.json', 'r', encoding='utf-8') as f:
print("open stage_list.json")
data = json.load(f)

with open('../templates/template_song_list.html', 'r', encoding='utf-8') as f:
print("open template_song_list.html")
template_string = f.read()

print(template_string)
for item in data:
print(item['title'])
song_title_list = item['song_title_list']
song_data_list = []
for song_title in song_title_list:
song_hash = Utils.process_string(song_title)
path_exists = os.path.exists(f'../docs/music_lib/music_call/auto-generated_md/{song_hash}.md')
song_data_list.append({'title': song_title, 'hash': song_hash, 'exists': path_exists})
print(song_data_list)
item['song_data_list'] = song_data_list

template = Template(template_string)
rendered_html = template.render(song_list=data)
print(rendered_html)
if not os.path.exists('../docs/music_lib/auto-generated_html'):
os.makedirs('../docs/music_lib/auto-generated_html')
with open('../docs/music_lib/auto-generated_html/stage_list.html', 'w', encoding='utf-8') as f:
Expand Down
2 changes: 1 addition & 1 deletion run_scripts.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ pip install -r requirements.txt
cd python_generator
python mix_generator.py
python music_call_generator.py
python song_list_generator.py
python stage_list_generator.py

cd ..
2 changes: 1 addition & 1 deletion run_scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ pip install -r requirements.txt
cd python_generator
python mix_generator.py
python music_call_generator.py
python song_list_generator.py
python stage_list_generator.py

cd ..

0 comments on commit 3d8fb15

Please sign in to comment.