diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-04-30 19:17:35 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-04-30 23:04:01 +0200 |
commit | aa44c16ce953c090b2eb3ce580c60fa8934a7720 (patch) | |
tree | 11710e34de01a2ac31e5acac9c8a62af3f09888a /module/vcomponent | |
parent | Update server to use app. (diff) | |
download | calp-aa44c16ce953c090b2eb3ce580c60fa8934a7720.tar.gz calp-aa44c16ce953c090b2eb3ce580c60fa8934a7720.tar.xz |
Change call signature for [gs]etf.
Diffstat (limited to '')
-rw-r--r-- | module/vcomponent.scm | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/module/vcomponent.scm b/module/vcomponent.scm index 83954f52..aaaf5d36 100644 --- a/module/vcomponent.scm +++ b/module/vcomponent.scm @@ -28,17 +28,17 @@ (define-method (init-app calendar-files) - (setf app 'calendars (load-calendars calendar-files)) + (setf 'calendars (load-calendars calendar-files)) - (setf app 'events + (setf 'events (concatenate ;; TODO does this drop events? (map (lambda (cal) (filter (lambda (o) (eq? 'VEVENT (type o))) (children cal))) - (getf app 'calendars)))) + (getf 'calendars)))) - (setf app 'fixed-and-repeating-events - (let* ((repeating regular (partition repeating? (getf app 'events)))) + (setf 'fixed-and-repeating-events + (let* ((repeating regular (partition repeating? (getf 'events)))) ;; (report-time! "Sorting") ;; NOTE There might be instances where we don't care if the @@ -48,22 +48,22 @@ (sort*! regular date/-time<? (extract 'DTSTART)) (sort*! repeating date/-time<? (extract 'DTSTART))))) - (setf app 'fixed-events (car (getf app 'fixed-and-repeating-events))) - (setf app 'repeating-events (cadr (getf app 'fixed-and-repeating-events))) + (setf 'fixed-events (car (getf 'fixed-and-repeating-events))) + (setf 'repeating-events (cadr (getf 'fixed-and-repeating-events))) - (setf app 'event-set (calculate-recurrence-set - (getf app 'fixed-events) - (getf app 'repeating-events))) + (setf 'event-set (calculate-recurrence-set + (getf 'fixed-events) + (getf 'repeating-events))) - (setf app 'uid-map + (setf 'uid-map (let ((ht (make-hash-table))) - (for-each (lambda (event) (hash-set! ht (attr event 'UID) event)) (getf app 'events)) + (for-each (lambda (event) (hash-set! ht (attr event 'UID) event)) (getf 'events)) ht))) (define-method (fixed-events-in-range start end) (filter-sorted (lambda (ev) ((in-date-range? start end) (as-date (attr ev 'DTSTART)))) - (getf app 'fixed-events))) + (getf 'fixed-events))) (define-method (get-event-by-uid uid) - (hash-ref (getf app 'uid-map) uid)) + (hash-ref (getf 'uid-map) uid)) |