added event details
This commit is contained in:
parent
75a2dff92d
commit
1cc223e567
|
@ -7,7 +7,7 @@ This is a calendar app which tries to bring something new to the functionality o
|
|||
This project is currently very WIP, the todo list is:
|
||||
|
||||
- [x] Basic decal functionality (receiving events and showing a tagged calendar)
|
||||
- [ ] Event details
|
||||
- [x] Event details
|
||||
- [ ] Creating events
|
||||
- [ ] Modifying events
|
||||
- [ ] Task lists
|
||||
|
|
27
decal
27
decal
|
@ -43,6 +43,12 @@ parser.add_argument("--create",
|
|||
parser.add_argument("--calendar",
|
||||
action="append",
|
||||
help="Specify a calendar (or multiple calendars) to sync from")
|
||||
parser.add_argument("-d",
|
||||
action="store_true",
|
||||
help="Show event details for selected day")
|
||||
parser.add_argument("-m",
|
||||
action="store_true",
|
||||
help="Show event details for entire month")
|
||||
parser.add_argument("-1",
|
||||
action="store_true",
|
||||
help="show only a single month (default)")
|
||||
|
@ -56,9 +62,6 @@ parser.add_argument("-n",
|
|||
action="store",
|
||||
type=int,
|
||||
help="show n months")
|
||||
parser.add_argument("-d",
|
||||
action="store_true",
|
||||
help="show event details")
|
||||
|
||||
args = vars(parser.parse_args())
|
||||
|
||||
|
@ -284,3 +287,21 @@ for count in range(3-(len(cal_prints)%3)):
|
|||
for cal in range(0,len(cal_prints),3):
|
||||
printlines(cal_prints[cal],cal_prints[cal+1],cal_prints[cal+2])
|
||||
|
||||
|
||||
def printDailyEvents(events,evtrack=[]):
|
||||
for event in events:
|
||||
if not event in evtrack:
|
||||
uid = event["uid"].encode()
|
||||
print(colorize(event["dtstart"]+" - "+event["dtend"],uid)+":\n- "+event["summary"])
|
||||
evtrack.append(event)
|
||||
|
||||
evtrack = []
|
||||
if args["d"]:
|
||||
printDailyEvents(events[str(selected_date)],evtrack=evtrack)
|
||||
exit(0)
|
||||
|
||||
if args["m"]:
|
||||
for day in range(*calendar.monthrange(args['year'],args['month'])):
|
||||
key = str(date(args['year'],args['month'],day))
|
||||
if key in events:
|
||||
printDailyEvents(events[key],evtrack=evtrack)
|
||||
|
|
Loading…
Reference in New Issue