diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-21 16:17:28 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-22 22:58:30 +0100 |
commit | d00fea566004e67161ee45246b239fff5d416b0e (patch) | |
tree | 5641c0c0d0e78b046b6045ed2440512f12259560 /module/calp/entry-points | |
parent | Complete rewrite of use2dot (diff) | |
download | calp-d00fea566004e67161ee45246b239fff5d416b0e.tar.gz calp-d00fea566004e67161ee45246b239fff5d416b0e.tar.xz |
Cleanup modules.
Primarly this moves all vcompenent input and output code to clearly
labeled modules, instead of being spread out. At the same time it also
removes a handfull of unused procedures.
Diffstat (limited to 'module/calp/entry-points')
-rw-r--r-- | module/calp/entry-points/benchmark.scm | 4 | ||||
-rw-r--r-- | module/calp/entry-points/convert.scm | 8 | ||||
-rw-r--r-- | module/calp/entry-points/html.scm | 4 | ||||
-rw-r--r-- | module/calp/entry-points/ical.scm | 2 | ||||
-rw-r--r-- | module/calp/entry-points/import.scm | 6 | ||||
-rw-r--r-- | module/calp/entry-points/server.scm | 3 | ||||
-rw-r--r-- | module/calp/entry-points/tidsrapport.scm | 6 |
7 files changed, 17 insertions, 16 deletions
diff --git a/module/calp/entry-points/benchmark.scm b/module/calp/entry-points/benchmark.scm index 851edc59..152a398c 100644 --- a/module/calp/entry-points/benchmark.scm +++ b/module/calp/entry-points/benchmark.scm @@ -5,8 +5,8 @@ :use-module (calp util options) :use-module ((srfi srfi-41) :select (stream->list)) - :use-module ((vcomponent instance methods) :select (get-event-set)) - :autoload (vcomponent instance) (global-event-object) + :use-module ((vcomponent util instance methods) :select (get-event-set)) + :autoload (vcomponent util instance) (global-event-object) :export (main) ) diff --git a/module/calp/entry-points/convert.scm b/module/calp/entry-points/convert.scm index 52ee6b2d..f05b1e7b 100644 --- a/module/calp/entry-points/convert.scm +++ b/module/calp/entry-points/convert.scm @@ -61,11 +61,11 @@ (case (string->symbol from) [(ical) ;; read ical - (@ (vcomponent ical parse) parse-calendar)] + (@ (vcomponent formats ical parse) parse-calendar)] [(xcal) ;; read xcal (compose - (@ (vcomponent xcal parse) sxcal->vcomponent) + (@ (vcomponent formats xcal parse) sxcal->vcomponent) ;; TODO strip *TOP* xml->sxml)] [else (error "")] @@ -76,13 +76,13 @@ [(ical) ;; write ical (lambda (component port) - (display ((@ (vcomponent ical output) component->ical-string) + (display ((@ (vcomponent formats ical output) component->ical-string) component) port))] [(xcal) ;; write xcal (lambda (component port) - (sxml->xml ((@ (vcomponent xcal output) vcomponent->sxcal) + (sxml->xml ((@ (vcomponent formats xcal output) vcomponent->sxcal) component) port))] [else (error "")])) diff --git a/module/calp/entry-points/html.scm b/module/calp/entry-points/html.scm index 39f00979..45e71947 100644 --- a/module/calp/entry-points/html.scm +++ b/module/calp/entry-points/html.scm @@ -14,14 +14,14 @@ :renamer (lambda _ 'render-calendar-wide)) :use-module ((calp html view calendar month) :select (render-calendar-table)) - :use-module ((vcomponent instance methods) + :use-module ((vcomponent util instance methods) :select (get-calendars get-event-set)) :use-module ((sxml simple) :select (sxml->xml)) :use-module ((sxml transformations) :select (href-transformer)) :use-module ((xdg basedir) :prefix xdg-) - :autoload (vcomponent instance) (global-event-object) + :autoload (vcomponent util instance) (global-event-object) ) diff --git a/module/calp/entry-points/ical.scm b/module/calp/entry-points/ical.scm index 15e677b5..0ac01b17 100644 --- a/module/calp/entry-points/ical.scm +++ b/module/calp/entry-points/ical.scm @@ -2,7 +2,7 @@ :export (main) :use-module (calp util) :use-module (calp util options) - :use-module (vcomponent ical output) + :use-module (vcomponent formats ical output) :use-module (ice-9 getopt-long) :use-module (datetime) ) diff --git a/module/calp/entry-points/import.scm b/module/calp/entry-points/import.scm index f25e642f..69c5b687 100644 --- a/module/calp/entry-points/import.scm +++ b/module/calp/entry-points/import.scm @@ -7,9 +7,11 @@ :use-module (srfi srfi-1) ;; TODO FIX ;; :use-module (output vdir) - :use-module ((vcomponent vdir save-delete) :select (save-event)) + :use-module ((vcomponent formats vdir save-delete) :select (save-event)) :use-module (vcomponent) - :autoload (vcomponent instance) (global-event-object) + ;; :use-module ((vcomponent formats ical parse) :select (parse-cal-path)) + :use-module ((vcomponent util parse-cal-path) :select (parse-cal-path)) + :autoload (vcomponent util instance) (global-event-object) ) (define options diff --git a/module/calp/entry-points/server.scm b/module/calp/entry-points/server.scm index a456c292..a7be4afd 100644 --- a/module/calp/entry-points/server.scm +++ b/module/calp/entry-points/server.scm @@ -1,7 +1,6 @@ (define-module (calp entry-points server) :use-module (calp util) :use-module (calp util options) - :use-module (calp util exceptions) :use-module (calp util config) :use-module (srfi srfi-1) @@ -68,7 +67,7 @@ (lambda _ (display "Received SIGUSR1, reloading calendars\n" (current-error-port)) - ((@ (vcomponent instance) reload))))) + ((@ (vcomponent util instance) reload))))) diff --git a/module/calp/entry-points/tidsrapport.scm b/module/calp/entry-points/tidsrapport.scm index 4716ceeb..abdd7aa2 100644 --- a/module/calp/entry-points/tidsrapport.scm +++ b/module/calp/entry-points/tidsrapport.scm @@ -50,8 +50,8 @@ (srfi srfi-1) (vcomponent) (datetime) - (vcomponent instance) - (vcomponent instance methods) + (vcomponent util instance) + (vcomponent util instance methods) (calp util) (ice-9 regex) (ice-9 popen) @@ -66,7 +66,7 @@ (define instances (group-by (compose day as-date (extract 'DTSTART)) (stream->list - ((@ (vcomponent search) execute-query) + ((@ (vcomponent util search) execute-query) (lambda (e) (define d (as-datetime (prop e 'DTSTART))) (define s (date year: year month: month day: 1)) |