aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-04-25 19:07:03 +0200
committerHugo Hörnquist <hugo@hornquist.se>2019-04-25 19:07:03 +0200
commit2d2c8a209ce5430ab4c4e18c7f04535942cf829f (patch)
tree854496a12f74844c20ad3355a7a0688aebf938cd
parentChange how in-date-range? does it's calculation. (diff)
downloadcalp-2d2c8a209ce5430ab4c4e18c7f04535942cf829f.tar.gz
calp-2d2c8a209ce5430ab4c4e18c7f04535942cf829f.tar.xz
Made none-output print statprof info.
-rwxr-xr-xmodule/main.scm3
-rw-r--r--module/output/none.scm19
2 files changed, 21 insertions, 1 deletions
diff --git a/module/main.scm b/module/main.scm
index 620e64fd..924a846c 100755
--- a/module/main.scm
+++ b/module/main.scm
@@ -16,6 +16,7 @@
(output html)
(output terminal)
+ (output none)
(ice-9 getopt-long)
@@ -57,7 +58,7 @@
(let ((ropt (ornull (option-ref opts '() '())
'("term"))))
((case (string->symbol (car ropt))
- ((none) (compose display list))
+ ((none) none-main)
((html) html-main)
((term) terminal-main))
c e ropt))))
diff --git a/module/output/none.scm b/module/output/none.scm
new file mode 100644
index 00000000..2380438b
--- /dev/null
+++ b/module/output/none.scm
@@ -0,0 +1,19 @@
+(define-module (output none)
+ #:use-module (statprof)
+ #:use-module (vcomponent group)
+ #:use-module (srfi srfi-41)
+ #:use-module (srfi srfi-19)
+ #:use-module (srfi srfi-19 util)
+ #:use-module (util)
+ #:export (none-main))
+
+(define (none-main calendars events args)
+ (define date (drop-time (current-date)))
+ (statprof
+ (lambda ()
+ (group->event-list
+ (stream-car
+ ;; TODO reusing the same grouping causes it to lose events.
+ ;; I currently have no idea why, but it's BAD.
+ (get-groups-between (group-stream events)
+ date date))))))