dotfiles/emacs/.emacs.d/snippets/python-mode/.yas-compiled-snippets.el
2016-11-24 21:41:10 +01:00

15 lines
2.5 KiB
EmacsLisp

;;; Compiled snippets and support files for `python-mode'
;;; Snippet definitions:
;;;
(yas-define-snippets 'python-mode
'(("url" "url(r'^$1', $2, name='$3')," "url" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/python-mode/url" nil nil)
("defm" "@method_decorator(permission_required('$1',\n raise_exception=True))\ndef dispatch(self, *args, **kwargs):\n '''Make sure the user has the $1 permission.'''\n return super(${3:`(progn (re-search-backward \"^[ \\t]*class \\\\(.+\\\\)(\") (match-string 1)))`}, self).dispatch(*args, **kwargs)" "Permission guard" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/python-mode/permission_guard" nil nil)
("defm" "def $1(self$2):\n '''$3'''\n $0" "method" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/python-mode/method" nil nil)
("from" "from ${1:module} import ${2:class_or_module}\n" "from ... import ..." nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/python-mode/import_from" nil nil)
("formvalid" "def form_valid(self, form):\n rv = super(`(let ((name (python-info-current-defun))) (substring name 0 (cl-position ?. name)))`, self).form_valid(form)\n $0\n return rv" "form_valid with return" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/python-mode/form_valid_with_return" nil nil)
("defm" "@record_activity(model=${1:`(progn (re-search-backward \"^[ \\t]*model = \\\\([a-zA-Z_].*\\\\)$\") (match-string 1))`})\ndef form_valid(self, form):\n '''Make sure any changes to the $1 model get logged.'''\n return super(${2:`(progn (re-search-backward \"^[ \\t]*class \\\\(.+\\\\)(\") (match-string 1)))`}, self).form_valid(form)" "Record form" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/python-mode/form_valid" nil nil)
("form" "class ${1:Model}Form(forms.ModelForm):\n '''Form for the $1 model.'''\n\n class Meta:\n model = $1" "Model Form" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/python-mode/form" nil nil)
("defm" "def ${1:name}(self, *args, **kwargs):\n '''$2'''\n return super(${3:`(progn (re-search-backward \"^[ \\t]*class \\\\(.+\\\\)(\") (match-string 1)))`}, self).$1(*args, **kwargs)" "Empty Defmethod" nil nil nil "/home/chelys/projects/dotfiles/emacs/.emacs.d/snippets/python-mode/defm_empty" nil nil)))
;;; Do not edit! File generated at Tue Nov 22 15:37:52 2016