initial commit

This commit is contained in:
Adam Goldsmith 2015-08-15 12:16:42 -04:00
commit e7352b0551
4 changed files with 60 additions and 0 deletions

13
static/index.css Normal file
View File

@ -0,0 +1,13 @@
body {
background-color: black;
color: white;
}
iframe {
display:inline-block;
}
iframe.embed {
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'invert\'><feColorMatrix in='SourceGraphic' type='matrix' values='-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0'/></filter></svg>#invert");
-webkit-filter: invert(100%);
}

27
templates/index.html Normal file
View File

@ -0,0 +1,27 @@
<!doctype html>
<head>
<title>Test App</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<!-- <meta http-equiv="refresh" content="10"> -->
</head>
<body>
<h4>TODO:</h4>
<ul>
{% for item in todo %}
<li>{{ item }}</li>
{% endfor %}
</ul>
<h4>HW:</h4>
<ul>
{% for item in hw %}
<li>{{ item }}</li>
{% endfor %}
</ul>
<iframe class="embed" id="forecast" type="text/html" frameborder="0" height="245" width="49%" src="http://forecast.io/embed/#lat=43.515250&lon=-72.110568&name=Home&units=si"> </iframe>
<script type="text/javascript">
document.write ('<p>Current time is: <span id="date-time">', new Date().toLocaleString(), '<\/span>.<\/p>')
if (document.getElementById) onload = function () {
setInterval ("document.getElementById ('date-time').firstChild.data = new Date().toLocaleString()", 50)
}
</script>
</body>

19
wallDisplay.py Normal file
View File

@ -0,0 +1,19 @@
from flask import Flask
from flask import render_template
app = Flask(__name__)
todo_file = "/home/adam/Sync/todo/todo.txt"
num_lines = 5
@app.route("/")
def index():
with open(todo_file) as f:
lines = [i for i in f.read().splitlines() if not i == ""]
lines.sort()
todo = lines[:num_lines]
hw = [i for i in lines if "+hw" in i][:num_lines]
print(hw)
return render_template('index.html', todo = todo, hw = hw)
if __name__ == "__main__":
app.run(debug=True, host='0.0.0.0')

1
wallDisplay.wsgi Normal file
View File

@ -0,0 +1 @@
from wallDisplay import app as application