Fix notify-mail.hy
This commit is contained in:
parent
6c6e738342
commit
4b5b0f0e1b
@ -20,10 +20,7 @@
|
|||||||
:text True)]
|
:text True)]
|
||||||
(match output
|
(match output
|
||||||
OutputType.LINES (str.splitlines result.stdout)
|
OutputType.LINES (str.splitlines result.stdout)
|
||||||
OutputType.JSON (let [json-root (json.loads result.stdout)]
|
OutputType.JSON (json.loads result.stdout))))
|
||||||
(if (!= (len json-root) 0)
|
|
||||||
(. json-root [0] [0] [(slice None -1)])
|
|
||||||
[])))))
|
|
||||||
|
|
||||||
(defclass Message []
|
(defclass Message []
|
||||||
(setv uid None
|
(setv uid None
|
||||||
@ -108,7 +105,7 @@
|
|||||||
"folder:Inbox"
|
"folder:Inbox"
|
||||||
:output OutputType.JSON)]
|
:output OutputType.JSON)]
|
||||||
(for [msg-json json-root]
|
(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
|
(Thread.start (Thread :target notify-message
|
||||||
:args #(msg))))))
|
:args #(msg))))))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user