aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-10-16 15:18:16 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-10-16 15:18:16 +0200
commit151c477392e85b1bd2b0ef8572f580ce0c040b0a (patch)
tree210aa10ff815422afb3c569c77ac4ee0712de0f8
parentDocument test utilities. (diff)
downloadcalp-151c477392e85b1bd2b0ef8572f580ce0c040b0a.tar.gz
calp-151c477392e85b1bd2b0ef8572f580ce0c040b0a.tar.xz
Update some data formats to properly use table type.
-rw-r--r--module/vcomponent/formats/common/types.scm10
-rw-r--r--module/vcomponent/formats/xcal/types.scm3
2 files changed, 8 insertions, 5 deletions
diff --git a/module/vcomponent/formats/common/types.scm b/module/vcomponent/formats/common/types.scm
index 68679fbc..e53bbf88 100644
--- a/module/vcomponent/formats/common/types.scm
+++ b/module/vcomponent/formats/common/types.scm
@@ -1,9 +1,10 @@
(define-module (vcomponent formats common types)
:use-module (hnh util)
:use-module (hnh util exceptions)
+ :use-module (hnh util table)
+ :use-module ((web uri) :select (string->uri))
:use-module (base64)
:use-module (datetime)
- :use-module (srfi srfi-9 gnu)
:use-module (srfi srfi-71)
:use-module (datetime timespec)
:use-module (calp translation)
@@ -12,7 +13,7 @@
;; BINARY
(define (parse-binary props value)
;; p 30
- (unless (string=? "BASE64" (hashq-ref props 'ENCODING))
+ (unless (string=? "BASE64" (table-get props 'ENCODING))
(warning (G_ "Binary field not marked ENCODING=BASE64")))
;; For icalendar no extra whitespace is allowed in a
@@ -38,8 +39,9 @@
(define parsed
(parse-ics-datetime
;; TODO props is no longer a (built-in) hash table
- value (hashq-ref props 'TZID #f)))
- (hashq-set! props '-X-HNH-ORIGINAL parsed)
+ value (table-get props 'TZID)))
+ ;; TODO update table
+ ;; (hashq-set! props '-X-HNH-ORIGINAL parsed)
(get-datetime parsed))
;; DURATION
diff --git a/module/vcomponent/formats/xcal/types.scm b/module/vcomponent/formats/xcal/types.scm
index 82121d5e..812f1d20 100644
--- a/module/vcomponent/formats/xcal/types.scm
+++ b/module/vcomponent/formats/xcal/types.scm
@@ -1,5 +1,6 @@
(define-module (vcomponent formats xcal types)
:use-module (hnh util)
+ :use-module (hnh util table)
:use-module (vcomponent formats ical types)
:use-module (datetime)
:use-module (calp translation)
@@ -16,7 +17,7 @@
(define (write-datetime p v)
`(,(xml xcal 'date-time)
,(datetime->string
- (hashq-ref p '-X-HNH-ORIGINAL v)
+ (table-get p '-X-HNH-ORIGINAL v)
;; 'Z' should be included for UTC,
;; other timezones MUST be specified
;; in the TZID parameter.