summaryrefslogtreecommitdiff
path: root/scripts/players-prepare-template.py
blob: 48632dac3a2a0b7835fc1c8c06ecb2db2537bafa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import copy, os, sys
import simplejson as json
from bs4 import BeautifulSoup as bs4

output_directory = sys.argv[1]

template = bs4(open('templates/player.html'), 'lxml')
menu_file = sys.argv[2]
menu_content = bs4(open(menu_file), 'html.parser')
menu = template.select('div.static-menu')[0]
menu.append(copy.copy(menu_content))

open(os.path.join(output_directory, 'index.html'), 'w').write(template.prettify())