diff options
Diffstat (limited to '.emacs.d/mysnippets/text-mode/python-mode')
| -rw-r--r-- | .emacs.d/mysnippets/text-mode/python-mode/__ | 3 | ||||
| -rw-r--r-- | .emacs.d/mysnippets/text-mode/python-mode/class | 54 | ||||
| -rw-r--r-- | .emacs.d/mysnippets/text-mode/python-mode/def | 35 | ||||
| -rw-r--r-- | .emacs.d/mysnippets/text-mode/python-mode/defm | 33 | ||||
| -rw-r--r-- | .emacs.d/mysnippets/text-mode/python-mode/for | 4 | ||||
| -rw-r--r-- | .emacs.d/mysnippets/text-mode/python-mode/ifmain | 4 | ||||
| -rw-r--r-- | .emacs.d/mysnippets/text-mode/python-mode/prop | 15 | ||||
| -rw-r--r-- | .emacs.d/mysnippets/text-mode/python-mode/propg | 9 | ||||
| -rw-r--r-- | .emacs.d/mysnippets/text-mode/python-mode/propsg | 12 | ||||
| -rw-r--r-- | .emacs.d/mysnippets/text-mode/python-mode/while | 4 |
10 files changed, 173 insertions, 0 deletions
diff --git a/.emacs.d/mysnippets/text-mode/python-mode/__ b/.emacs.d/mysnippets/text-mode/python-mode/__ new file mode 100644 index 0000000..a67dc49 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/python-mode/__ | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | #name : __...__ | ||
| 2 | # -- | ||
| 3 | __${init}__ \ No newline at end of file | ||
diff --git a/.emacs.d/mysnippets/text-mode/python-mode/class b/.emacs.d/mysnippets/text-mode/python-mode/class new file mode 100644 index 0000000..72f339b --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/python-mode/class | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | # -*- coding: utf-8 -*- | ||
| 2 | # name: class | ||
| 3 | # contributor: Orestis Markou | ||
| 4 | # contributor: Nishio Hirokazu | ||
| 5 | # contributor: Yasser González Fernández <yglez@uh.cu> | ||
| 6 | # -- | ||
| 7 | class ${1:ClassName}(${2:object}): | ||
| 8 | """$3 | ||
| 9 | """ | ||
| 10 | |||
| 11 | def __init__(self, $4): | ||
| 12 | """$5 | ||
| 13 | ${4:$ | ||
| 14 | (let* ((indent | ||
| 15 | (concat "\n" (make-string (current-column) 32))) | ||
| 16 | (args | ||
| 17 | (mapconcat | ||
| 18 | '(lambda (x) | ||
| 19 | (if (not (string= (nth 0 x) "")) | ||
| 20 | (concat "- " (char-to-string 96) (nth 0 x) | ||
| 21 | (char-to-string 96) ":"))) | ||
| 22 | (mapcar | ||
| 23 | '(lambda (x) | ||
| 24 | (mapcar | ||
| 25 | (lambda (x) | ||
| 26 | (replace-regexp-in-string "[[:blank:]]*$" "" | ||
| 27 | (replace-regexp-in-string "^[[:blank:]]*" "" x))) x)) | ||
| 28 | (mapcar '(lambda (x) (split-string x "=")) | ||
| 29 | (split-string text ","))) | ||
| 30 | indent))) | ||
| 31 | (if (string= args "") | ||
| 32 | (make-string 3 34) | ||
| 33 | (mapconcat | ||
| 34 | 'identity | ||
| 35 | (list "" "Arguments:" args (make-string 3 34)) | ||
| 36 | indent))) | ||
| 37 | } | ||
| 38 | ${4:$ | ||
| 39 | (mapconcat | ||
| 40 | '(lambda (x) | ||
| 41 | (if (not (string= (nth 0 x) "")) | ||
| 42 | (concat "self._" (nth 0 x) " = " (nth 0 x)))) | ||
| 43 | (mapcar | ||
| 44 | '(lambda (x) | ||
| 45 | (mapcar | ||
| 46 | '(lambda (x) | ||
| 47 | (replace-regexp-in-string "[[:blank:]]*$" "" | ||
| 48 | (replace-regexp-in-string "^[[:blank:]]*" "" x))) | ||
| 49 | x)) | ||
| 50 | (mapcar '(lambda (x) (split-string x "=")) | ||
| 51 | (split-string text ","))) | ||
| 52 | (concat "\n" (make-string (current-column) 32))) | ||
| 53 | } | ||
| 54 | $0 | ||
diff --git a/.emacs.d/mysnippets/text-mode/python-mode/def b/.emacs.d/mysnippets/text-mode/python-mode/def new file mode 100644 index 0000000..f82f791 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/python-mode/def | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | # -*- coding: utf-8 -*- | ||
| 2 | # name: def | ||
| 3 | # contributor: Orestis Markou | ||
| 4 | # contributor: Yasser González Fernández <yglez@uh.cu> | ||
| 5 | # -- | ||
| 6 | def ${1:name}($2): | ||
| 7 | """$3 | ||
| 8 | ${2:$ | ||
| 9 | (let* | ||
| 10 | ((indent | ||
| 11 | (concat "\n" (make-string (current-column) 32))) | ||
| 12 | (args | ||
| 13 | (mapconcat | ||
| 14 | '(lambda (x) | ||
| 15 | (if (not (string= (nth 0 x) "")) | ||
| 16 | (concat "- " (char-to-string 96) (nth 0 x) | ||
| 17 | (char-to-string 96) ":"))) | ||
| 18 | (mapcar | ||
| 19 | '(lambda (x) | ||
| 20 | (mapcar | ||
| 21 | '(lambda (x) | ||
| 22 | (replace-regexp-in-string "[[:blank:]]*$" "" | ||
| 23 | (replace-regexp-in-string "^[[:blank:]]*" "" x))) | ||
| 24 | x)) | ||
| 25 | (mapcar '(lambda (x) (split-string x "=")) | ||
| 26 | (split-string text ","))) | ||
| 27 | indent))) | ||
| 28 | (if (string= args "") | ||
| 29 | (make-string 3 34) | ||
| 30 | (mapconcat | ||
| 31 | 'identity | ||
| 32 | (list "" "Arguments:" args (make-string 3 34)) | ||
| 33 | indent))) | ||
| 34 | } | ||
| 35 | $0 | ||
diff --git a/.emacs.d/mysnippets/text-mode/python-mode/defm b/.emacs.d/mysnippets/text-mode/python-mode/defm new file mode 100644 index 0000000..dc25827 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/python-mode/defm | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | # -*- coding: utf-8 -*- | ||
| 2 | # name: defm | ||
| 3 | # contributor: Yasser Gonz¨¢lez Fern¨¢ndez <yglez@uh.cu> | ||
| 4 | # -- | ||
| 5 | def ${1:name}(self, $2): | ||
| 6 | """$3 | ||
| 7 | ${2:$ | ||
| 8 | (let* ((indent | ||
| 9 | (concat "\n" (make-string (current-column) 32))) | ||
| 10 | (args | ||
| 11 | (mapconcat | ||
| 12 | '(lambda (x) | ||
| 13 | (if (not (string= (nth 0 x) "")) | ||
| 14 | (concat "- " (char-to-string 96) (nth 0 x) | ||
| 15 | (char-to-string 96) ":"))) | ||
| 16 | (mapcar | ||
| 17 | '(lambda (x) | ||
| 18 | (mapcar | ||
| 19 | '(lambda (x) | ||
| 20 | (replace-regexp-in-string "[[:blank:]]*$" "" | ||
| 21 | (replace-regexp-in-string "^[[:blank:]]*" "" x))) | ||
| 22 | x)) | ||
| 23 | (mapcar '(lambda (x) (split-string x "=")) | ||
| 24 | (split-string text ","))) | ||
| 25 | indent))) | ||
| 26 | (if (string= args "") | ||
| 27 | (make-string 3 34) | ||
| 28 | (mapconcat | ||
| 29 | 'identity | ||
| 30 | (list "" "Arguments:" args (make-string 3 34)) | ||
| 31 | indent))) | ||
| 32 | } | ||
| 33 | $0 | ||
diff --git a/.emacs.d/mysnippets/text-mode/python-mode/for b/.emacs.d/mysnippets/text-mode/python-mode/for new file mode 100644 index 0000000..84f3ddd --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/python-mode/for | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #name : for ... in ... : ... | ||
| 2 | # -- | ||
| 3 | for ${var} in ${collection}: | ||
| 4 | $0 \ No newline at end of file | ||
diff --git a/.emacs.d/mysnippets/text-mode/python-mode/ifmain b/.emacs.d/mysnippets/text-mode/python-mode/ifmain new file mode 100644 index 0000000..6224923 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/python-mode/ifmain | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #name : if __name__ == '__main__': ... | ||
| 2 | # -- | ||
| 3 | if __name__ == '__main__': | ||
| 4 | $0 \ No newline at end of file | ||
diff --git a/.emacs.d/mysnippets/text-mode/python-mode/prop b/.emacs.d/mysnippets/text-mode/python-mode/prop new file mode 100644 index 0000000..107730a --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/python-mode/prop | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | # contributor: Mads D. Kristensen <madsdk@gmail.com> | ||
| 2 | # name: prop | ||
| 3 | # -- | ||
| 4 | def ${1:foo}(): | ||
| 5 | doc = """${2:Doc string}""" | ||
| 6 | def fget(self): | ||
| 7 | return self._$1 | ||
| 8 | def fset(self, value): | ||
| 9 | self._$1 = value | ||
| 10 | def fdel(self): | ||
| 11 | del self._$1 | ||
| 12 | return locals() | ||
| 13 | $1 = property(**$1()) | ||
| 14 | |||
| 15 | $0 | ||
diff --git a/.emacs.d/mysnippets/text-mode/python-mode/propg b/.emacs.d/mysnippets/text-mode/python-mode/propg new file mode 100644 index 0000000..7e994b6 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/python-mode/propg | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | #contributor : Julio Carlos Menendez <godinblack@gmail.com> | ||
| 2 | #name : _get_foo ... foo=property(...) | ||
| 3 | # -- | ||
| 4 | def _get_${1:foo}(self): | ||
| 5 | return self._$1 | ||
| 6 | |||
| 7 | $1 = property(_get_$1) | ||
| 8 | |||
| 9 | $0 | ||
diff --git a/.emacs.d/mysnippets/text-mode/python-mode/propsg b/.emacs.d/mysnippets/text-mode/python-mode/propsg new file mode 100644 index 0000000..e09d82a --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/python-mode/propsg | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | #contributor : Julio Carlos Menendez <godinblack@gmail.com> | ||
| 2 | #name : _get_foo ... _set_foo ... foo=property(...) | ||
| 3 | # -- | ||
| 4 | def _set_${1:foo}(self, value): | ||
| 5 | self._$1 = value | ||
| 6 | |||
| 7 | def _get_$1(self): | ||
| 8 | return self._$1 | ||
| 9 | |||
| 10 | $1 = property(_get_$1, _set_$1) | ||
| 11 | |||
| 12 | $0 | ||
diff --git a/.emacs.d/mysnippets/text-mode/python-mode/while b/.emacs.d/mysnippets/text-mode/python-mode/while new file mode 100644 index 0000000..704dd7c --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/python-mode/while | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #name : while ... : ... | ||
| 2 | # -- | ||
| 3 | while ${condition}: | ||
| 4 | $0 \ No newline at end of file | ||
