begin to write the function to parse response
This commit is contained in:
parent
4520162ab1
commit
c620cd8838
1 changed files with 12 additions and 0 deletions
12
empc.el
12
empc.el
|
|
@ -73,6 +73,18 @@ return at the end of a request.")
|
|||
(when empc-verbose
|
||||
(message "empc: %s" msg)))
|
||||
|
||||
(defun empc-response-parse-message (msg)
|
||||
"Check the result code and parse the response into a plist."
|
||||
(let* ((data (split-string msg "\n" t))
|
||||
(status (last data)))
|
||||
(when (and (stringp (car data))
|
||||
(string-match "^OK\\( MPD \\)?" (car data)))
|
||||
(setq data (cdr data)))
|
||||
;; TODO: checker le status.
|
||||
;; (dolist (line )
|
||||
;; )
|
||||
))
|
||||
|
||||
(defun empc-response-parse-status (closure msg)
|
||||
"Parse the response into a plist."
|
||||
(let ((data (split-string msg "\n" t)))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue