Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4dca4d5
commit 9277f99
Showing
12 changed files
with
1,916 additions
and
372 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import jinja2, json | ||
import os | ||
|
||
def delete_if_exsist(filename): | ||
if os.path.exists(filename): | ||
os.remove(filename) | ||
else: | ||
pass | ||
|
||
with open(f'audio.json') as f: | ||
data = json.load(f) | ||
|
||
html = jinja2.Environment( | ||
loader=jinja2.FileSystemLoader('./')).get_template('template.html').render(data = data) | ||
|
||
OUT = "index.html" # Compiled Index.HTML file with all the audio information from the JSON datastore | ||
delete_if_exsist(OUT) # Remove if already existing | ||
|
||
with open(OUT,'w') as f: | ||
f.write(html) |
Oops, something went wrong.