summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/main.py b/main.py
index 802c328..cd85abd 100755
--- a/main.py
+++ b/main.py
@@ -70,6 +70,16 @@ def formatprojects(d):
output+=","
output+=p["name"]
return output
+def formatnotes(d):
+ output=""
+ for e in events:
+ _e=events[e]
+ if (not _e["hidden"]) and (_e["date"].date() == d.date() or matchrepeat(d, e)):
+ if len(output)!=0:
+ output+="\n\n"
+ if _e["note"] is not None:
+ output+= _e["note"]
+ return output
#### Other help functions
def add_row(t,row,div):
total=0
@@ -125,6 +135,7 @@ for e in _i["events"]:
events[e]["start"]=parse_time(_e["start"]) if "start" in _e.keys() else None
events[e]["end"]=parse_time(_e["end"]) if "end" in _e.keys() else None
events[e]["room"]=_e["room"] if "room" in _e.keys() else None
+ events[e]["note"]=_e["note"] if "note" in _e.keys() else None
if "repeat" in _e.keys():
events[e]["repeat"]["every"]=_e["repeat"]["every"]
events[e]["repeat"]["until"]=parse_date(_e["repeat"]["until"]) if "until" in _e["repeat"].keys() else None
@@ -167,7 +178,14 @@ if not _ccal["hidden"]:
formatprojects(getnextdayn(d, 1)),
formatprojects(getnextdayn(d, 2)),
formatprojects(getnextdayn(d, 3)),
- formatprojects(getnextdayn(d, 4))],False)
+ formatprojects(getnextdayn(d, 4))],True)
+ if _ccal["show_note"]:
+ add_row(t,[_ccal["labels"]["note"],
+ formatnotes(getnextdayn(d, 0)),
+ formatnotes(getnextdayn(d, 1)),
+ formatnotes(getnextdayn(d, 2)),
+ formatnotes(getnextdayn(d, 3)),
+ formatnotes(getnextdayn(d, 4))],False)
print(t.get_formatted_string(_c["format"]))
d=getnextmonday(d)
w+=1