From 4b5b0f0e1bf352f34aaaff22292f79495423b991 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Fri, 26 May 2023 13:27:43 -0700 Subject: [PATCH] Fix notify-mail.hy --- notify-mail.hy | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/notify-mail.hy b/notify-mail.hy index e60e099..3060aad 100755 --- a/notify-mail.hy +++ b/notify-mail.hy @@ -20,10 +20,7 @@ :text True)] (match output OutputType.LINES (str.splitlines result.stdout) - OutputType.JSON (let [json-root (json.loads result.stdout)] - (if (!= (len json-root) 0) - (. json-root [0] [0] [(slice None -1)]) - []))))) + OutputType.JSON (json.loads result.stdout)))) (defclass Message [] (setv uid None @@ -108,7 +105,7 @@ "folder:Inbox" :output OutputType.JSON)] (for [msg-json json-root] - (let [msg (Message.from-json msg-json mail-root)] + (let [msg (Message.from-json (. msg-json [0] [0]) mail-root)] (Thread.start (Thread :target notify-message :args #(msg))))))