class 724 B

123456789101112131415161718192021222324
  1. # -*- coding: utf-8 -*-
  2. # name: class
  3. # key: class
  4. # --
  5. class ${1:ClassName}(${2:object}):
  6. def __init__(self, $4):
  7. super($1, self).__init__()
  8. ${4:$
  9. (mapconcat
  10. '(lambda (x)
  11. (if (not (string= (nth 0 x) ""))
  12. (concat "self._" (nth 0 x) " = " (nth 0 x))))
  13. (mapcar
  14. '(lambda (x)
  15. (mapcar
  16. '(lambda (x)
  17. (replace-regexp-in-string "[[:blank:]]*$" ""
  18. (replace-regexp-in-string "^[[:blank:]]*" "" x)))
  19. x))
  20. (mapcar '(lambda (x) (split-string x "="))
  21. (split-string text ",")))
  22. (concat "\n" (make-string (current-column) 32)))
  23. }
  24. $0