Skip to content

Commit

Permalink
write out guide.html anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
joshinils committed Sep 5, 2020
1 parent aefc545 commit 7e6cc51
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ __pycache__
.venv/

.vscode
guide.html
19 changes: 18 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from flask import Flask
from flask import render_template
import xml.etree.ElementTree as ET

import jinja2
from models.programme import Programme
from models.channelName import ChannelName
from models.tvGuide import TvGuide
Expand Down Expand Up @@ -45,6 +45,23 @@
app = Flask(__name__)


templateLoader = jinja2.FileSystemLoader(searchpath="./templates/")
templateEnv = jinja2.Environment(loader=templateLoader)
TEMPLATE_FILE = "hello.html"
template = templateEnv.get_template(TEMPLATE_FILE)


def url_for(where, filename):
return "/" + where + "/" + filename


guideHtmlString = template.render(guide=guide, url_for=url_for)

f = open("guide.html", "w")
f.write(guideHtmlString)
f.close()


@app.route('/')
def index():
return render_template('hello.html', guide=guide)
Expand Down
5 changes: 3 additions & 2 deletions static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ body {
hyphens: auto;
/**/
float: left;
margin: 5px 10px 0px 10px;
padding: 5px 10px 0px 10px;
}

.channelHead {
Expand All @@ -58,7 +58,8 @@ body {
}

.programme.prominent {
margin-top: 10px;
padding-top: 5px;
padding-bottom: 5px;
}

.programme.nonprominent {
Expand Down

0 comments on commit 7e6cc51

Please sign in to comment.