From 1baf017aaaf38fb6a13bedc2c97f6450748ae738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 5 Jul 2020 22:20:24 +0200 Subject: Remove some TODO:s. --- module/datetime.scm | 2 +- module/output/common.scm | 9 --------- module/output/ical.scm | 2 +- module/util.scm | 5 +++++ module/vcomponent.scm | 13 ++----------- module/vcomponent/base.scm | 3 +++ module/vcomponent/parse/component.scm | 2 -- 7 files changed, 12 insertions(+), 24 deletions(-) (limited to 'module') diff --git a/module/datetime.scm b/module/datetime.scm index a95eac47..f20a6b8f 100644 --- a/module/datetime.scm +++ b/module/datetime.scm @@ -864,7 +864,7 @@ ;;; OPERATIONS -;; TODO +1 month is weird for late days in a month. +;; NOTE +1 month is weird for late days in a month. ;; is the last of january +1 month the last of february, ;; or a few days into march? It's at least not the 31 of ;; February, as the code is currently written. diff --git a/module/output/common.scm b/module/output/common.scm index 0d266d01..f572a282 100644 --- a/module/output/common.scm +++ b/module/output/common.scm @@ -9,15 +9,6 @@ :use-module (vcomponent) ) -;; TODO this is also defined @ (vcomponent parse component) -(define-public (x-property? symb) - (string=? "X-" (string-take (symbol->string symb) 2))) - -;; TODO this is also defined twice -(define-public (generate-uuid) - ((@ (rnrs io ports) call-with-port) - ((@ (ice-9 popen) open-input-pipe) "uuidgen") - (@ (ice-9 rdelim) read-line))) (define*-public (internal-field? symbol optional: (prefix "X-HNH-")) (string=? prefix diff --git a/module/output/ical.scm b/module/output/ical.scm index 4822bf4a..dd7653cb 100644 --- a/module/output/ical.scm +++ b/module/output/ical.scm @@ -175,7 +175,7 @@ (unless (prop event 'UID) (set! (prop event 'UID) - (generate-uuid))) + (uuidgen))) (with-output-to-file (glob (format #f "~a/~a.ics" calendar-path diff --git a/module/util.scm b/module/util.scm index abb12f8b..8a3e38d4 100644 --- a/module/util.scm +++ b/module/util.scm @@ -543,3 +543,8 @@ (for-each (lambda (pair) (setenv (car pair) (caddr pair))) env-pairs) return))])) + +(define-public (uuidgen) + ((@ (rnrs io ports) call-with-port) + ((@ (ice-9 popen) open-input-pipe) "uuidgen") + (@ (ice-9 rdelim) read-line))) diff --git a/module/vcomponent.scm b/module/vcomponent.scm index f9d04d35..2eb4ef2c 100644 --- a/module/vcomponent.scm +++ b/module/vcomponent.scm @@ -63,17 +63,8 @@ -(use-modules (output ical) - (ice-9 popen) - ((ice-9 rdelim) :select (read-line)) - ((rnrs io ports) :select (call-with-port)) - ) - - -(define (uuidgen) - (call-with-port (open-input-pipe "uuidgen") - read-line)) - +;;; TODO vcomponent should NOT depend on output +(use-modules (output ical)) (define-public (add-event calendar event) diff --git a/module/vcomponent/base.scm b/module/vcomponent/base.scm index 6b9363b6..413e7c0c 100644 --- a/module/vcomponent/base.scm +++ b/module/vcomponent/base.scm @@ -188,3 +188,6 @@ (define-public (key=? k1 k2) (eq? (as-symb k1) (as-symb k2))) + +(define-public (x-property? symb) + (string=? "X-" (string-take (symbol->string symb) 2))) diff --git a/module/vcomponent/parse/component.scm b/module/vcomponent/parse/component.scm index 25d2642d..41ef30f5 100644 --- a/module/vcomponent/parse/component.scm +++ b/module/vcomponent/parse/component.scm @@ -72,8 +72,6 @@ (cons -1 semi-idxs) semi-idxs))) -(define (x-property? symb) - (string=? "X-" (string-take (symbol->string symb) 2))) #; '(ATTACH ATTENDEE CATEGORIES -- cgit v1.2.3