From 68647d3c1aa8130df878223638bc54c5d332cc5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 3 Aug 2020 00:58:40 +0200 Subject: Move methods to own module for easier loading. --- module/entry-points/import.scm | 4 ++-- module/entry-points/server.scm | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'module/entry-points') diff --git a/module/entry-points/import.scm b/module/entry-points/import.scm index 9e8e3d7b..956ccc91 100644 --- a/module/entry-points/import.scm +++ b/module/entry-points/import.scm @@ -4,10 +4,10 @@ :use-module (util options) :use-module (ice-9 getopt-long) :use-module (ice-9 rdelim) - :use-module (vcomponent) :use-module (srfi srfi-1) :use-module (output vdir) - :autoload (vcomponent instance) (get-calendars global-event-object) + :use-module (vcomponent) + :autoload (vcomponent instance) (global-event-object) ) (define options diff --git a/module/entry-points/server.scm b/module/entry-points/server.scm index 824770af..7fa6ceb0 100644 --- a/module/entry-points/server.scm +++ b/module/entry-points/server.scm @@ -33,7 +33,7 @@ :use-module (output html) :use-module (output ical) - :autoload (vcomponent instance) (get-calendars global-event-object) + :autoload (vcomponent instance) (global-event-object) :export (main) ) @@ -113,12 +113,12 @@ (return (build-response code: 400) "uid required")) - (aif (get-event-by-uid uid) + (aif (get-event-by-uid global-event-object uid) (begin ;; It's hard to properly remove a file. I also want a way to undo accidental ;; deletions. Therefore I simply save the X-HNH-REMOVED flag to the file, and ;; then simple don't use those events when loading. - (catch 'stack-overflow (lambda () (remove-event it)) + (catch 'stack-overflow (lambda () (remove-event global-event-object it)) (lambda _ (display "It overflew...\n" (current-error-port)) (return (build-response code: 500) @@ -240,7 +240,7 @@ (print-all-events)))))) (GET "/calendar/:uid{.*}.xcs" (uid) - (aif (get-event-by-uid uid) + (aif (get-event-by-uid global-event-object uid) (return '((content-type application/calendar+xml)) ;; TODO sxml->xml takes a port, would be better ;; to give it the return port imidiately. @@ -256,7 +256,7 @@ (format #f "No component with UID=~a found." uid)))) (GET "/calendar/:uid{.*}.ics" (uid) - (aif (get-event-by-uid uid) + (aif (get-event-by-uid global-event-object uid) (return '((content-type text/calendar)) (with-output-to-string (lambda () (print-components-with-fake-parent -- cgit v1.2.3