def (1172B)
1 # -*- coding: utf-8 -*- 2 # name: de 3 # contributor: Orestis Markou 4 # contributor: Yasser González Fernández <yglez@uh.cu> 5 # contributor: Tibor Simko <tibor.simko@cern.ch> 6 # -- 7 def ${1:name}($2): 8 """ 9 $3 10 ${2:$ 11 (let* ((indent 12 (concat "\n" (make-string (current-column) 32))) 13 (args 14 (mapconcat 15 '(lambda (x) 16 (if (not (string= (nth 0 x) "")) 17 (concat "@param " (nth 0 x) ": " indent 18 "@type " (nth 0 x) ": "))) 19 (mapcar 20 '(lambda (x) 21 (mapcar 22 '(lambda (x) 23 (replace-regexp-in-string "[[:blank:]]*$" "" 24 (replace-regexp-in-string "^[[:blank:]]*" "" x))) 25 x)) 26 (mapcar '(lambda (x) (split-string x "=")) 27 (split-string yas-text ","))) 28 indent))) 29 (if (string= args "") 30 (concat indent "@return: " indent "@rtype: " indent (make-string 3 34)) 31 (mapconcat 32 'identity 33 (list "" args "@return: " "@rtype: " (make-string 3 34)) 34 indent))) 35 } 36 $0