diff --git a/web/app.py b/web/app.py deleted file mode 100644 index 45acd3e..0000000 --- a/web/app.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/python - -import sqlite3 -import time - -from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash - - -app = Flask("skybot") - - -app.config.from_pyfile('config.cfg') - -def connect_db(): - conn = sqlite3.connect(app.config['DATABASE']) - conn.row_factory = sqlite3.Row - return conn - - -@app.before_request -def before_request(): - g.db = connect_db() - - -@app.after_request -def after_request(response): - g.db.close() - return response - - -@app.template_filter('ptime') -def ptime(t): - return time.strftime('%Y.%m.%d', time.gmtime(int(t))) - - -@app.route("/") -def index(): - return "Hello World!" - - -@app.route("/quotes") -def list_quotes(): - quotes = g.db.execute('SELECT * FROM quote WHERE deleted = 0 AND chan = ? ' - 'order by nick asc, time asc', ('#cobol',)).fetchall() - - return render_template('list_quotes.html', quotes=quotes) - - -if __name__ == "__main__": - app.run(port=8080, debug=True) diff --git a/web/config.cfg b/web/config.cfg deleted file mode 100644 index 7004a0c..0000000 --- a/web/config.cfg +++ /dev/null @@ -1 +0,0 @@ -DATABASE = '../persist/skybot.irc.synirc.net.db' diff --git a/web/main.py b/web/main.py deleted file mode 100644 index 63d2a27..0000000 --- a/web/main.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/python - -import sqlite3 - -db = sqlite3.connect - -from flask import Flask - -app = Flask("skybot") - -@app.route("/") -def index(): - return "Hello World!" - -if __name__ == "__main__": - app.run(debug=True) diff --git a/web/templates/list_quotes.html b/web/templates/list_quotes.html deleted file mode 100644 index 6a7b247..0000000 --- a/web/templates/list_quotes.html +++ /dev/null @@ -1,5 +0,0 @@ -
-{% for quote in quotes %} - {{ loop.index }} {{ quote.time | ptime }} <{{ quote.nick }}> {{ quote.msg }} -{%- endfor %} -