Added navbar and updated thumbnail generator

This commit is contained in:
simon987
2018-03-21 21:53:49 -04:00
parent 90c1de3362
commit b94fce4e0b
27 changed files with 5760 additions and 133 deletions

27
run.py
View File

@@ -1,18 +1,15 @@
from flask import Flask, render_template, send_file, request, redirect, flash, session
from indexer import Indexer
from flask import Flask, render_template, request, redirect, flash, session
from storage import Directory, Option, Task
from storage import LocalStorage, DuplicateDirectoryException
from crawler import RunningTask, TaskManager
import json
# indexer = Indexer("fse")
app = Flask(__name__)
app.secret_key = "A very secret key"
storage = LocalStorage("local_storage.db")
# tm = TaskManager(storage)
tm = TaskManager(storage)
@app.route("/")
def tmp_route():
@@ -75,26 +72,6 @@ def directory_update(dir_id):
return redirect("/directory/" + str(dir_id))
@app.route("/directory/<int:dir_id>/add_opt")
def directory_add_opt(dir_id):
key = request.args.get("key")
value = request.args.get("value")
if key is not None and value is not None:
storage.save_option(Option(key, value, dir_id))
flash("<strong>Added option</strong>", "success")
return redirect("/directory/" + str(dir_id))
@app.route("/directory/<int:dir_id>/del_opt/<int:opt_id>")
def directory_del_opt(dir_id, opt_id):
storage.del_option(opt_id)
return redirect("/directory/" + str(dir_id))
@app.route("/directory/<int:dir_id>/update_opt")
def directory_update_opt(dir_id):