1(import [enum [Enum]])23;; From src/protocol/Ack.hxx in mpd source4(defclass ACKError [Enum]5 (setv NOT_LIST 1)6 (setv ARG 2)7 (setv PASSWORD 3)8 (setv PERMISSION 4)9 (setv UNKNOWN 5)10 (setv NO_EXIST 50)11 (setv PLAYLIST_MAX 51)12 (setv SYSTEM 52)13 (setv PLAYLIST_LOAD 53)14 (setv UPDATE_ALREADY 54)15 (setv PLAYER_SYNC 55)16 (setv EXIST 56))1718(defclass MPDException [Exception]19 (defn __init__ [self code msg &optional [lst-num 0] [cur-cmd ""]]20 (if (not (isinstance code ACKError))21 (raise (TypeError "Exception code must be an ACKError")))22 (setv self.code code)23 (setv self.msg msg)24 (setv self.lst-num lst-num)25 (setv self.cur-cmd cur-cmd))2627 ;; Format: ACK [error@command_listNum] {current_command} message_text28 (defn __str__ [self]29 (% "ACK [%d@%d] {%s} %s" (, self.code.value self.lst-num30 self.cur-cmd self.msg))))3132(defclass MPDNotFoundError [MPDException]33 (defn __init__ [self]34 (.__init__ (super) ACKError.NO_EXIST "no such file")))3536(defclass MPDBadIndexError [MPDException]37 (defn __init__ [self]38 (.__init__ (super) ACKError.ARG "Bad song index")))