X-Git-Url: https://plomlompom.com/repos/new_day?a=blobdiff_plain;f=todo.py;h=dc3a346efebccc30be5d82e1840b635d79c0b5b2;hb=9637ae6c570e9cf0cce500d85af03c74d6771362;hp=8da5f9e3cabb6cd70e4448502245fb6ef797c5c8;hpb=0f70b22c0f0e2983edc0a60309f49636db75da6b;p=misc diff --git a/todo.py b/todo.py index 8da5f9e..dc3a346 100644 --- a/todo.py +++ b/todo.py @@ -1,398 +1,1218 @@ -from plomlib import PlomDB, run_server, PlomHandler, PlomException +from plomlib import PlomDB, run_server, PlomHandler, PlomException import json from uuid import uuid4 -from datetime import datetime +from datetime import datetime, timedelta from urllib.parse import parse_qs -from jinja2 import Template +from jinja2 import Environment as JinjaEnv, FileSystemLoader as JinjaFSLoader from urllib.parse import urlparse +from os.path import split as path_split db_path = '/home/plom/org/todo_new.json' -# db_path = '/home/plom/public_repos/misc/todo_new.json' server_port = 8082 +DATE_FORMAT = '%Y-%m-%d' +j2env = JinjaEnv(loader=JinjaFSLoader('todo_templates')) -html_head = """ - -
-all | edit day: -choose -do -{{ date }} ({{ day.todos_sum |round(2) }}) {{ day.comment|e }} | ||
{{ todo.title }} | {% if todo.done %}â{% endif %} | {{ todo.weight }} |