diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2017-11-15 21:12:09 +0100 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2017-11-15 21:12:09 +0100 |
commit | 7111edab4f2f5bf8860f3a640021c94607516749 (patch) | |
tree | e7423d5727e0542c9e17f03555ff1fb7b111cf64 | |
parent | 4fd6942274ed22f5829d6aed340aa7fdb544ff30 (diff) |
debbugs: bug: Parse timestamps and booleans.
* debbugs/bug.scm (soap-bug->bug): Parse timestamps (date,
log-modified, last-modified) and booleans (archived, unarchived).
* README.org: Remove parsing of raw values from list of missing
features.
-rw-r--r-- | README.org | 1 | ||||
-rw-r--r-- | debbugs/bug.scm | 14 |
2 files changed, 14 insertions, 1 deletions
@@ -16,7 +16,6 @@ tracker. + TLS support (required for GNU debbugs instance) + convenience procedures for =<bug>= records (e.g. =bug-done?=) -+ parsing of raw values (e.g. timestamps) + monadic interface * Hacking diff --git a/debbugs/bug.scm b/debbugs/bug.scm index 62b8cfc..0b10979 100644 --- a/debbugs/bug.scm +++ b/debbugs/bug.scm @@ -20,6 +20,7 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) #:use-module (srfi srfi-9 gnu) + #:use-module (srfi srfi-19) #:use-module (ice-9 match) #:use-module ((sxml xpath) #:hide (filter)) #:use-module (debbugs soap) @@ -113,6 +114,19 @@ (let ((bug-properties (map soap->scheme ((sxpath '(urn:Debbugs/SOAP:value *any*)) bug-item)))) (apply bug (append-map (match-lambda + ;; timestamps + ((and ((or 'date 'log-modified 'last-modified) . _) + (key . value)) + (list (symbol->keyword key) + (time-utc->date (make-time time-utc 0 value)))) + ;; booleans + ((and ((or 'archived 'unarchived) . _) + (key . value)) + (list (symbol->keyword key) + (if (number? value) + ((negate zero?) value) + #f))) + ;; anything else ((key . value) (list (symbol->keyword key) value))) (filter (match-lambda |