From ad0579d7d3332335e02b5b2349d1fc4a68561561 Mon Sep 17 00:00:00 2001 From: Jorgen Schaefer Date: Sun, 16 Jun 2013 11:32:00 +0200 Subject: [PATCH 01/16] elpy-initialize-variables: Add the Elpy snippet directory. Elpy now ships with a few YASnippet snippets for Python. Fixes #43. --- python-mode/__enter__ | 10 ++++++++++ python-mode/__exit__ | 6 ++++++ python-mode/super | 7 +++++++ 3 files changed, 23 insertions(+) create mode 100644 python-mode/__enter__ create mode 100644 python-mode/__exit__ create mode 100644 python-mode/super diff --git a/python-mode/__enter__ b/python-mode/__enter__ new file mode 100644 index 000000000..4c74b667f --- /dev/null +++ b/python-mode/__enter__ @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: __enter__ +# key: __enter__ +# expand-env: ((yas-indent-line nil)) +# -- +__enter__(self): + $1 + + def __exit__(self, exc_type, exc_value, traceback): + $2 diff --git a/python-mode/__exit__ b/python-mode/__exit__ new file mode 100644 index 000000000..e04a43342 --- /dev/null +++ b/python-mode/__exit__ @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: __exit__ +# key: __exit__ +# -- +__exit__(self, exc_type, exc_value, traceback): + $0 diff --git a/python-mode/super b/python-mode/super new file mode 100644 index 000000000..6361b4586 --- /dev/null +++ b/python-mode/super @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: super +# key: super +# expand-env: ((class (lambda () (let ((info (python-info-current-defun))) (if info (car (split-string info "\\.")) "class")))) (method (lambda () (let ((info (python-info-current-defun))) (if info (cadr (split-string info "\\.")) "method")))) (object (lambda () (if (and (python-nav-beginning-of-defun) (re-search-forward "(\\([^),=]*\\)" nil t)) (match-string-no-properties 1) "self")))) +# -- +super(`(funcall class)`, `(funcall object)`).`(funcall method)`($1) + $0 \ No newline at end of file From 09722d509c0b1495c777eb4dd363f3baa02eaa15 Mon Sep 17 00:00:00 2001 From: Jorgen Schaefer Date: Fri, 16 May 2014 18:22:36 +0200 Subject: [PATCH 02/16] Small rework of the snippets. The enter and exit snippets now conform to the yasnippet-snippets repository (mostly), while super now makes use of the .yas-setup.el mechanism and is seriously improved. There's a new snippet for __init__ methods, too, which automatically assigns arguments to instance variables. --- python-mode/.yas-setup.el | 62 +++++++++++++++++++++++++++++++++++++++ python-mode/__enter__ | 11 ++++--- python-mode/__exit__ | 3 +- python-mode/__init__ | 11 +++++++ python-mode/super | 9 +++--- 5 files changed, 85 insertions(+), 11 deletions(-) create mode 100644 python-mode/.yas-setup.el create mode 100644 python-mode/__init__ diff --git a/python-mode/.yas-setup.el b/python-mode/.yas-setup.el new file mode 100644 index 000000000..c5283237a --- /dev/null +++ b/python-mode/.yas-setup.el @@ -0,0 +1,62 @@ +(defun elpy-snippet-split-args (arg-string) + "Split a python argument string into ((name, default)..) tuples" + (mapcar (lambda (x) + (split-string x "[[:blank:]]*=[[:blank:]]*" t)) + (split-string arg-string "[[:blank:]]*,[[:blank:]]*" t))) + +(defun elpy-snippet-current-method-and-args () + "Return information on the current definition." + (let ((current-defun (python-info-current-defun)) + (current-arglist + (save-excursion + (python-nav-beginning-of-defun) + (when (re-search-forward "(" nil t) + (let* ((start (point)) + (end (progn + (forward-char -1) + (forward-sexp) + (- (point) 1)))) + (elpy-snippet-split-args + (buffer-substring-no-properties start end)))))) + class method args) + (when (not current-arglist) + (setq current-arglist '(("self")))) + (if (and current-defun + (string-match "^\\(.*\\)\\.\\(.*\\)$" current-defun)) + (setq class (match-string 1 current-defun) + method (match-string 2 current-defun)) + (setq class "Class" + method "method")) + (setq args (mapcar #'car current-arglist)) + (list class method args))) + +(defun elpy-snippet-init-assignments (arg-string) + "Return the typical __init__ assignments for arguments." + (let ((indentation (make-string (save-excursion + (goto-char start-point) + (current-indentation)) + ?\s))) + (mapconcat (lambda (arg) + (if (string-match "^\\*" (car arg)) + "" + (format "self.%s = %s\n%s" + (car arg) + (car arg) + indentation))) + (elpy-snippet-split-args arg-string) + ""))) + +(defun elpy-snippet-super-form () + "Return (Class, first-arg).method" + (let* ((defun-info (elpy-snippet-current-method-and-args)) + (class (nth 0 defun-info)) + (method (nth 1 defun-info)) + (args (nth 2 defun-info)) + (first-arg (nth 0 args))) + (format "(%s, %s).%s" class first-arg method))) + +(defun elpy-snippet-super-arguments () + "Return the argument list for the current method." + (mapconcat (lambda (x) x) + (cdr (nth 2 (elpy-snippet-current-method-and-args))) + ", ")) diff --git a/python-mode/__enter__ b/python-mode/__enter__ index 4c74b667f..3dcc3ba65 100644 --- a/python-mode/__enter__ +++ b/python-mode/__enter__ @@ -1,10 +1,9 @@ # -*- mode: snippet -*- # name: __enter__ -# key: __enter__ -# expand-env: ((yas-indent-line nil)) +# key: ent +# group: dunder methods # -- -__enter__(self): - $1 +def __enter__(self): + $0 - def __exit__(self, exc_type, exc_value, traceback): - $2 + return self \ No newline at end of file diff --git a/python-mode/__exit__ b/python-mode/__exit__ index e04a43342..4ddd0a4e3 100644 --- a/python-mode/__exit__ +++ b/python-mode/__exit__ @@ -1,6 +1,7 @@ # -*- mode: snippet -*- # name: __exit__ -# key: __exit__ +# key: ex +# group: dunder methods # -- __exit__(self, exc_type, exc_value, traceback): $0 diff --git a/python-mode/__init__ b/python-mode/__init__ new file mode 100644 index 000000000..cc2f7db35 --- /dev/null +++ b/python-mode/__init__ @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: __init__ with assignment +# key: init +# group: Definitions +# contributor: Jorgen Schaefer +# -- +def __init__(self${1:, args}): + """$2 + + """ + ${1:$(elpy-snippet-init-assignments text)} diff --git a/python-mode/super b/python-mode/super index 6361b4586..baf97fe80 100644 --- a/python-mode/super +++ b/python-mode/super @@ -1,7 +1,8 @@ # -*- mode: snippet -*- -# name: super +# name: super() call # key: super -# expand-env: ((class (lambda () (let ((info (python-info-current-defun))) (if info (car (split-string info "\\.")) "class")))) (method (lambda () (let ((info (python-info-current-defun))) (if info (cadr (split-string info "\\.")) "method")))) (object (lambda () (if (and (python-nav-beginning-of-defun) (re-search-forward "(\\([^),=]*\\)" nil t)) (match-string-no-properties 1) "self")))) +# group: Class +# contributor: Jorgen Schaefer # -- -super(`(funcall class)`, `(funcall object)`).`(funcall method)`($1) - $0 \ No newline at end of file +super`(elpy-snippet-super-form)`(${1:`(elpy-snippet-super-arguments)`}) +$0 \ No newline at end of file From 82bf3dd1b8fddcb36221991a614667673722d49e Mon Sep 17 00:00:00 2001 From: Jorgen Schaefer Date: Fri, 6 Jun 2014 19:51:58 +0200 Subject: [PATCH 03/16] Rework and expand the snippet collection. --- python-mode/__abs__ | 7 +++++++ python-mode/__add__ | 7 +++++++ python-mode/__and__ | 7 +++++++ python-mode/__call__ | 7 +++++++ python-mode/__cmp__ | 7 +++++++ python-mode/__coerce__ | 7 +++++++ python-mode/__complex__ | 7 +++++++ python-mode/__contains__ | 7 +++++++ python-mode/__del__ | 7 +++++++ python-mode/__delattr__ | 7 +++++++ python-mode/__delete__ | 7 +++++++ python-mode/__delitem__ | 7 +++++++ python-mode/__div__ | 7 +++++++ python-mode/__divmod__ | 7 +++++++ python-mode/__enter__ | 4 ++-- python-mode/__eq__ | 7 +++++++ python-mode/__exit__ | 6 +++--- python-mode/__float__ | 7 +++++++ python-mode/__floordiv__ | 7 +++++++ python-mode/__ge__ | 7 +++++++ python-mode/__get__ | 7 +++++++ python-mode/__getattr__ | 7 +++++++ python-mode/__getattribute__ | 7 +++++++ python-mode/__getitem__ | 7 +++++++ python-mode/__gt__ | 7 +++++++ python-mode/__hash__ | 7 +++++++ python-mode/__hex__ | 7 +++++++ python-mode/__iadd__ | 7 +++++++ python-mode/__iand__ | 7 +++++++ python-mode/__idiv__ | 7 +++++++ python-mode/__ifloordiv__ | 7 +++++++ python-mode/__ilshift__ | 7 +++++++ python-mode/__imod__ | 7 +++++++ python-mode/__imul__ | 7 +++++++ python-mode/__index__ | 7 +++++++ python-mode/__init__ | 5 ++--- python-mode/__instancecheck__ | 7 +++++++ python-mode/__int__ | 7 +++++++ python-mode/__invert__ | 7 +++++++ python-mode/__ior__ | 7 +++++++ python-mode/__ipow__ | 7 +++++++ python-mode/__irshift__ | 7 +++++++ python-mode/__isub__ | 7 +++++++ python-mode/__iter__ | 7 +++++++ python-mode/__itruediv__ | 7 +++++++ python-mode/__ixor__ | 7 +++++++ python-mode/__le__ | 7 +++++++ python-mode/__len__ | 7 +++++++ python-mode/__long__ | 7 +++++++ python-mode/__lshift__ | 7 +++++++ python-mode/__lt__ | 7 +++++++ python-mode/__mod__ | 7 +++++++ python-mode/__mul__ | 7 +++++++ python-mode/__ne__ | 7 +++++++ python-mode/__neg__ | 7 +++++++ python-mode/__new__ | 10 ++++++++++ python-mode/__nonzero__ | 7 +++++++ python-mode/__oct__ | 7 +++++++ python-mode/__or__ | 7 +++++++ python-mode/__pos__ | 7 +++++++ python-mode/__pow__ | 7 +++++++ python-mode/__radd__ | 7 +++++++ python-mode/__rand__ | 7 +++++++ python-mode/__rdivmod__ | 7 +++++++ python-mode/__repr__ | 7 +++++++ python-mode/__reversed__ | 7 +++++++ python-mode/__rfloordiv__ | 7 +++++++ python-mode/__rlshift__ | 7 +++++++ python-mode/__rmod__ | 7 +++++++ python-mode/__rmul__ | 7 +++++++ python-mode/__ror__ | 7 +++++++ python-mode/__rpow__ | 7 +++++++ python-mode/__rrshift__ | 7 +++++++ python-mode/__rshift__ | 7 +++++++ python-mode/__rsub__ | 7 +++++++ python-mode/__rtruediv__ | 7 +++++++ python-mode/__rxor__ | 7 +++++++ python-mode/__set__ | 7 +++++++ python-mode/__setattr__ | 7 +++++++ python-mode/__setitem__ | 7 +++++++ python-mode/__slots__ | 7 +++++++ python-mode/__str__ | 7 +++++++ python-mode/__sub__ | 7 +++++++ python-mode/__subclasscheck__ | 7 +++++++ python-mode/__truediv__ | 7 +++++++ python-mode/__unicode__ | 7 +++++++ python-mode/__xor__ | 7 +++++++ python-mode/ase | 6 ++++++ python-mode/asne | 6 ++++++ python-mode/asr | 7 +++++++ python-mode/class | 13 +++++++++++++ python-mode/defs | 7 +++++++ python-mode/enc | 6 ++++++ python-mode/env | 6 ++++++ python-mode/from | 7 +++++++ python-mode/pdb | 6 ++++++ python-mode/py3 | 7 +++++++ python-mode/super | 5 ++--- 98 files changed, 671 insertions(+), 11 deletions(-) create mode 100644 python-mode/__abs__ create mode 100644 python-mode/__add__ create mode 100644 python-mode/__and__ create mode 100644 python-mode/__call__ create mode 100644 python-mode/__cmp__ create mode 100644 python-mode/__coerce__ create mode 100644 python-mode/__complex__ create mode 100644 python-mode/__contains__ create mode 100644 python-mode/__del__ create mode 100644 python-mode/__delattr__ create mode 100644 python-mode/__delete__ create mode 100644 python-mode/__delitem__ create mode 100644 python-mode/__div__ create mode 100644 python-mode/__divmod__ create mode 100644 python-mode/__eq__ create mode 100644 python-mode/__float__ create mode 100644 python-mode/__floordiv__ create mode 100644 python-mode/__ge__ create mode 100644 python-mode/__get__ create mode 100644 python-mode/__getattr__ create mode 100644 python-mode/__getattribute__ create mode 100644 python-mode/__getitem__ create mode 100644 python-mode/__gt__ create mode 100644 python-mode/__hash__ create mode 100644 python-mode/__hex__ create mode 100644 python-mode/__iadd__ create mode 100644 python-mode/__iand__ create mode 100644 python-mode/__idiv__ create mode 100644 python-mode/__ifloordiv__ create mode 100644 python-mode/__ilshift__ create mode 100644 python-mode/__imod__ create mode 100644 python-mode/__imul__ create mode 100644 python-mode/__index__ create mode 100644 python-mode/__instancecheck__ create mode 100644 python-mode/__int__ create mode 100644 python-mode/__invert__ create mode 100644 python-mode/__ior__ create mode 100644 python-mode/__ipow__ create mode 100644 python-mode/__irshift__ create mode 100644 python-mode/__isub__ create mode 100644 python-mode/__iter__ create mode 100644 python-mode/__itruediv__ create mode 100644 python-mode/__ixor__ create mode 100644 python-mode/__le__ create mode 100644 python-mode/__len__ create mode 100644 python-mode/__long__ create mode 100644 python-mode/__lshift__ create mode 100644 python-mode/__lt__ create mode 100644 python-mode/__mod__ create mode 100644 python-mode/__mul__ create mode 100644 python-mode/__ne__ create mode 100644 python-mode/__neg__ create mode 100644 python-mode/__new__ create mode 100644 python-mode/__nonzero__ create mode 100644 python-mode/__oct__ create mode 100644 python-mode/__or__ create mode 100644 python-mode/__pos__ create mode 100644 python-mode/__pow__ create mode 100644 python-mode/__radd__ create mode 100644 python-mode/__rand__ create mode 100644 python-mode/__rdivmod__ create mode 100644 python-mode/__repr__ create mode 100644 python-mode/__reversed__ create mode 100644 python-mode/__rfloordiv__ create mode 100644 python-mode/__rlshift__ create mode 100644 python-mode/__rmod__ create mode 100644 python-mode/__rmul__ create mode 100644 python-mode/__ror__ create mode 100644 python-mode/__rpow__ create mode 100644 python-mode/__rrshift__ create mode 100644 python-mode/__rshift__ create mode 100644 python-mode/__rsub__ create mode 100644 python-mode/__rtruediv__ create mode 100644 python-mode/__rxor__ create mode 100644 python-mode/__set__ create mode 100644 python-mode/__setattr__ create mode 100644 python-mode/__setitem__ create mode 100644 python-mode/__slots__ create mode 100644 python-mode/__str__ create mode 100644 python-mode/__sub__ create mode 100644 python-mode/__subclasscheck__ create mode 100644 python-mode/__truediv__ create mode 100644 python-mode/__unicode__ create mode 100644 python-mode/__xor__ create mode 100644 python-mode/ase create mode 100644 python-mode/asne create mode 100644 python-mode/asr create mode 100644 python-mode/class create mode 100644 python-mode/defs create mode 100644 python-mode/enc create mode 100644 python-mode/env create mode 100644 python-mode/from create mode 100644 python-mode/pdb create mode 100644 python-mode/py3 diff --git a/python-mode/__abs__ b/python-mode/__abs__ new file mode 100644 index 000000000..12b1585a5 --- /dev/null +++ b/python-mode/__abs__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __abs__ +# key: __abs__ +# group: Special methods +# -- +def __abs__(self): + return $0 diff --git a/python-mode/__add__ b/python-mode/__add__ new file mode 100644 index 000000000..a70f20f5e --- /dev/null +++ b/python-mode/__add__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __add__ +# key: __add__ +# group: Special methods +# -- +def __add__(self, other): + return $0 diff --git a/python-mode/__and__ b/python-mode/__and__ new file mode 100644 index 000000000..56961d342 --- /dev/null +++ b/python-mode/__and__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __and__ +# key: __and__ +# group: Special methods +# -- +def __and__(self, other): + return $0 diff --git a/python-mode/__call__ b/python-mode/__call__ new file mode 100644 index 000000000..dea846320 --- /dev/null +++ b/python-mode/__call__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __call__ +# key: __call__ +# group: Special methods +# -- +def __call__(self, ${1:*args}): + return $0 diff --git a/python-mode/__cmp__ b/python-mode/__cmp__ new file mode 100644 index 000000000..c26662142 --- /dev/null +++ b/python-mode/__cmp__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __cmp__ +# key: __cmp__ +# group: Special methods +# -- +def __cmp__(self, other): + return $0 diff --git a/python-mode/__coerce__ b/python-mode/__coerce__ new file mode 100644 index 000000000..297138ca9 --- /dev/null +++ b/python-mode/__coerce__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __coerce__ +# key: __coerce__ +# group: Special methods +# -- +def __coerce__(self, other): + return $0 diff --git a/python-mode/__complex__ b/python-mode/__complex__ new file mode 100644 index 000000000..108e47ecf --- /dev/null +++ b/python-mode/__complex__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __complex__ +# key: __complex__ +# group: Special methods +# -- +def __complex__(self): + return $0 diff --git a/python-mode/__contains__ b/python-mode/__contains__ new file mode 100644 index 000000000..5376c2dda --- /dev/null +++ b/python-mode/__contains__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __contains__ +# key: __contains__ +# group: Special methods +# -- +def __contains__(self, item): + return $0 diff --git a/python-mode/__del__ b/python-mode/__del__ new file mode 100644 index 000000000..a3a1a04b9 --- /dev/null +++ b/python-mode/__del__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __del__ +# key: __del__ +# group: Special methods +# -- +def __del__(self): + $0 diff --git a/python-mode/__delattr__ b/python-mode/__delattr__ new file mode 100644 index 000000000..fe41a47aa --- /dev/null +++ b/python-mode/__delattr__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __delattr__ +# key: __delattr__ +# group: Special methods +# -- +def __delattr__(self, name): + $0 diff --git a/python-mode/__delete__ b/python-mode/__delete__ new file mode 100644 index 000000000..7b216b479 --- /dev/null +++ b/python-mode/__delete__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __delete__ +# key: __delete__ +# group: Special methods +# -- +def __delete__(self, instance): + $0 diff --git a/python-mode/__delitem__ b/python-mode/__delitem__ new file mode 100644 index 000000000..fd79a02c6 --- /dev/null +++ b/python-mode/__delitem__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __delitem__ +# key: __delitem__ +# group: Special methods +# -- +def __delitem__(self, key): + $0 diff --git a/python-mode/__div__ b/python-mode/__div__ new file mode 100644 index 000000000..8da4ea92b --- /dev/null +++ b/python-mode/__div__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __div__ +# key: __div__ +# group: Special methods +# -- +def __div__(self, other): + return $0 diff --git a/python-mode/__divmod__ b/python-mode/__divmod__ new file mode 100644 index 000000000..586327479 --- /dev/null +++ b/python-mode/__divmod__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __divmod__ +# key: __divmod__ +# group: Special methods +# -- +def __divmod__(self, other): + return $0 diff --git a/python-mode/__enter__ b/python-mode/__enter__ index 3dcc3ba65..0ad587fc0 100644 --- a/python-mode/__enter__ +++ b/python-mode/__enter__ @@ -1,7 +1,7 @@ # -*- mode: snippet -*- # name: __enter__ -# key: ent -# group: dunder methods +# key: __enter__ +# group: Special methods # -- def __enter__(self): $0 diff --git a/python-mode/__eq__ b/python-mode/__eq__ new file mode 100644 index 000000000..0f772fff7 --- /dev/null +++ b/python-mode/__eq__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __eq__ +# key: __eq__ +# group: Special methods +# -- +def __eq__(self, other): + return $0 diff --git a/python-mode/__exit__ b/python-mode/__exit__ index 4ddd0a4e3..e19452411 100644 --- a/python-mode/__exit__ +++ b/python-mode/__exit__ @@ -1,7 +1,7 @@ # -*- mode: snippet -*- # name: __exit__ -# key: ex -# group: dunder methods +# key: __exit__ +# group: Special methods # -- -__exit__(self, exc_type, exc_value, traceback): +def __exit__(self, exc_type, exc_value, traceback): $0 diff --git a/python-mode/__float__ b/python-mode/__float__ new file mode 100644 index 000000000..6f1ab4ae4 --- /dev/null +++ b/python-mode/__float__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __float__ +# key: __float__ +# group: Special methods +# -- +def __float__(self): + return $0 diff --git a/python-mode/__floordiv__ b/python-mode/__floordiv__ new file mode 100644 index 000000000..117f174d1 --- /dev/null +++ b/python-mode/__floordiv__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __floordiv__ +# key: __floordiv__ +# group: Special methods +# -- +def __floordiv__(self, other): + return $0 diff --git a/python-mode/__ge__ b/python-mode/__ge__ new file mode 100644 index 000000000..a7f5c49b5 --- /dev/null +++ b/python-mode/__ge__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ge__ +# key: __ge__ +# group: Special methods +# -- +def __ge__(self, other): + return $0 diff --git a/python-mode/__get__ b/python-mode/__get__ new file mode 100644 index 000000000..9d4a9fa98 --- /dev/null +++ b/python-mode/__get__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __get__ +# key: __get__ +# group: Special methods +# -- +def __get__(self, instance, owner): + return $0 diff --git a/python-mode/__getattr__ b/python-mode/__getattr__ new file mode 100644 index 000000000..07e9afcdd --- /dev/null +++ b/python-mode/__getattr__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __getattr__ +# key: __getattr__ +# group: Special methods +# -- +def __getattr__(self, name): + return $0 diff --git a/python-mode/__getattribute__ b/python-mode/__getattribute__ new file mode 100644 index 000000000..e6bfedd72 --- /dev/null +++ b/python-mode/__getattribute__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __getattribute__ +# key: __getattribute__ +# group: Special methods +# -- +def __getattribute__(self, name): + return $0 diff --git a/python-mode/__getitem__ b/python-mode/__getitem__ new file mode 100644 index 000000000..6d73dc72f --- /dev/null +++ b/python-mode/__getitem__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __getitem__ +# key: __getitem__ +# group: Special methods +# -- +def __getitem__(self, key): + return $0 diff --git a/python-mode/__gt__ b/python-mode/__gt__ new file mode 100644 index 000000000..0fb0eb3b3 --- /dev/null +++ b/python-mode/__gt__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __gt__ +# key: __gt__ +# group: Special methods +# -- +def __gt__(self, other): + return $0 diff --git a/python-mode/__hash__ b/python-mode/__hash__ new file mode 100644 index 000000000..a11710446 --- /dev/null +++ b/python-mode/__hash__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __hash__ +# key: __hash__ +# group: Special methods +# -- +def __hash__(self): + return $0 diff --git a/python-mode/__hex__ b/python-mode/__hex__ new file mode 100644 index 000000000..62df1d716 --- /dev/null +++ b/python-mode/__hex__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __hex__ +# key: __hex__ +# group: Special methods +# -- +def __hex__(self): + return $0 diff --git a/python-mode/__iadd__ b/python-mode/__iadd__ new file mode 100644 index 000000000..fe1f2445e --- /dev/null +++ b/python-mode/__iadd__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __iadd__ +# key: __iadd__ +# group: Special methods +# -- +def __iadd__(self, other): + return $0 diff --git a/python-mode/__iand__ b/python-mode/__iand__ new file mode 100644 index 000000000..6b027e91a --- /dev/null +++ b/python-mode/__iand__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __iand__ +# key: __iand__ +# group: Special methods +# -- +def __iand__(self, other): + return $0 diff --git a/python-mode/__idiv__ b/python-mode/__idiv__ new file mode 100644 index 000000000..fb32a864c --- /dev/null +++ b/python-mode/__idiv__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __idiv__ +# key: __idiv__ +# group: Special methods +# -- +def __idiv__(self, other): + return $0 diff --git a/python-mode/__ifloordiv__ b/python-mode/__ifloordiv__ new file mode 100644 index 000000000..8d200726e --- /dev/null +++ b/python-mode/__ifloordiv__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ifloordiv__ +# key: __ifloordiv__ +# group: Special methods +# -- +def __ifloordiv__(self, other): + return $0 diff --git a/python-mode/__ilshift__ b/python-mode/__ilshift__ new file mode 100644 index 000000000..e29895fb8 --- /dev/null +++ b/python-mode/__ilshift__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ilshift__ +# key: __ilshift__ +# group: Special methods +# -- +def __ilshift__(self, other): + return $0 diff --git a/python-mode/__imod__ b/python-mode/__imod__ new file mode 100644 index 000000000..4d74b1351 --- /dev/null +++ b/python-mode/__imod__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __imod__ +# key: __imod__ +# group: Special methods +# -- +def __imod__(self, other): + return $0 diff --git a/python-mode/__imul__ b/python-mode/__imul__ new file mode 100644 index 000000000..ee8482985 --- /dev/null +++ b/python-mode/__imul__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __imul__ +# key: __imul__ +# group: Special methods +# -- +def __imul__(self, other): + return $0 diff --git a/python-mode/__index__ b/python-mode/__index__ new file mode 100644 index 000000000..7337f76db --- /dev/null +++ b/python-mode/__index__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __index__ +# key: __index__ +# group: Special methods +# -- +def __index__(self): + return $0 diff --git a/python-mode/__init__ b/python-mode/__init__ index cc2f7db35..575256b08 100644 --- a/python-mode/__init__ +++ b/python-mode/__init__ @@ -1,8 +1,7 @@ # -*- mode: snippet -*- # name: __init__ with assignment -# key: init -# group: Definitions -# contributor: Jorgen Schaefer +# key: __init__ +# group: Special methods # -- def __init__(self${1:, args}): """$2 diff --git a/python-mode/__instancecheck__ b/python-mode/__instancecheck__ new file mode 100644 index 000000000..4b567aa23 --- /dev/null +++ b/python-mode/__instancecheck__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __instancecheck__ +# key: __instancecheck__ +# group: Special methods +# -- +def __instancecheck__(self, instance): + return $0 diff --git a/python-mode/__int__ b/python-mode/__int__ new file mode 100644 index 000000000..fa136df36 --- /dev/null +++ b/python-mode/__int__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __int__ +# key: __int__ +# group: Special methods +# -- +def __int__(self): + $0 diff --git a/python-mode/__invert__ b/python-mode/__invert__ new file mode 100644 index 000000000..bbf1df45f --- /dev/null +++ b/python-mode/__invert__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __invert__ +# key: __invert__ +# group: Special methods +# -- +def __invert__(self): + return $0 diff --git a/python-mode/__ior__ b/python-mode/__ior__ new file mode 100644 index 000000000..045a0d54f --- /dev/null +++ b/python-mode/__ior__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ior__ +# key: __ior__ +# group: Special methods +# -- +def __ior__(self, other): + return $0 diff --git a/python-mode/__ipow__ b/python-mode/__ipow__ new file mode 100644 index 000000000..ec62f49fb --- /dev/null +++ b/python-mode/__ipow__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ipow__ +# key: __ipow__ +# group: Special methods +# -- +def __ipow__(self, other): + return $0 diff --git a/python-mode/__irshift__ b/python-mode/__irshift__ new file mode 100644 index 000000000..193f790e7 --- /dev/null +++ b/python-mode/__irshift__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __irshift__ +# key: __irshift__ +# group: Special methods +# -- +def __irshift__(self, other): + return $0 diff --git a/python-mode/__isub__ b/python-mode/__isub__ new file mode 100644 index 000000000..70fd5747a --- /dev/null +++ b/python-mode/__isub__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __isub__ +# key: __isub__ +# group: Special methods +# -- +def __isub__(self, other): + return $0 diff --git a/python-mode/__iter__ b/python-mode/__iter__ new file mode 100644 index 000000000..a7002e0ba --- /dev/null +++ b/python-mode/__iter__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __iter__ +# key: __iter__ +# group: Special methods +# -- +def __iter__(self): + $0 diff --git a/python-mode/__itruediv__ b/python-mode/__itruediv__ new file mode 100644 index 000000000..14caec60d --- /dev/null +++ b/python-mode/__itruediv__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __itruediv__ +# key: __itruediv__ +# group: Special methods +# -- +def __itruediv__(self, other): + return $0 diff --git a/python-mode/__ixor__ b/python-mode/__ixor__ new file mode 100644 index 000000000..ffba3edea --- /dev/null +++ b/python-mode/__ixor__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ixor__ +# key: __ixor__ +# group: Special methods +# -- +def __ixor__(self, other): + return $0 diff --git a/python-mode/__le__ b/python-mode/__le__ new file mode 100644 index 000000000..f08aebe83 --- /dev/null +++ b/python-mode/__le__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __le__ +# key: __le__ +# group: Special methods +# -- +def __le__(self, other): + return $0 diff --git a/python-mode/__len__ b/python-mode/__len__ new file mode 100644 index 000000000..7d15f93d6 --- /dev/null +++ b/python-mode/__len__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __len__ +# key: __len__ +# group: Special methods +# -- +def __len__(self): + return $0 diff --git a/python-mode/__long__ b/python-mode/__long__ new file mode 100644 index 000000000..16c3cd20b --- /dev/null +++ b/python-mode/__long__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __long__ +# key: __long__ +# group: Special methods +# -- +def __long__(self): + return $0 diff --git a/python-mode/__lshift__ b/python-mode/__lshift__ new file mode 100644 index 000000000..493a21f95 --- /dev/null +++ b/python-mode/__lshift__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __lshift__ +# key: __lshift__ +# group: Special methods +# -- +def __lshift__(self, other): + return $0 diff --git a/python-mode/__lt__ b/python-mode/__lt__ new file mode 100644 index 000000000..a47a24801 --- /dev/null +++ b/python-mode/__lt__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __lt__ +# key: __lt__ +# group: Special methods +# -- +def __lt__(self, other): + return $0 diff --git a/python-mode/__mod__ b/python-mode/__mod__ new file mode 100644 index 000000000..94a5ff56c --- /dev/null +++ b/python-mode/__mod__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __mod__ +# key: __mod__ +# group: Special methods +# -- +def __mod__(self, other): + return $0 diff --git a/python-mode/__mul__ b/python-mode/__mul__ new file mode 100644 index 000000000..f4a3d7a6c --- /dev/null +++ b/python-mode/__mul__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __mul__ +# key: __mul__ +# group: Special methods +# -- +def __mul__(self, other): + return $0 diff --git a/python-mode/__ne__ b/python-mode/__ne__ new file mode 100644 index 000000000..684f96754 --- /dev/null +++ b/python-mode/__ne__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ne__ +# key: __ne__ +# group: Special methods +# -- +def __ne__(self, other): + return $0 diff --git a/python-mode/__neg__ b/python-mode/__neg__ new file mode 100644 index 000000000..b430dcd44 --- /dev/null +++ b/python-mode/__neg__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __neg__ +# key: __neg__ +# group: Special methods +# -- +def __neg__(self): + return $0 diff --git a/python-mode/__new__ b/python-mode/__new__ new file mode 100644 index 000000000..01e788e63 --- /dev/null +++ b/python-mode/__new__ @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: __new__ +# key: __new__ +# group: Special methods +# -- +def __new__(cls${1:, args}): + """$2 + + """ + ${1:$(elpy-snippet-init-assignments text)} diff --git a/python-mode/__nonzero__ b/python-mode/__nonzero__ new file mode 100644 index 000000000..cef110ea6 --- /dev/null +++ b/python-mode/__nonzero__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __nonzero__ +# key: __nonzero__ +# group: Special methods +# -- +def __nonzero__(self): + return $0 diff --git a/python-mode/__oct__ b/python-mode/__oct__ new file mode 100644 index 000000000..7a46b56ab --- /dev/null +++ b/python-mode/__oct__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __oct__ +# key: __oct__ +# group: Special methods +# -- +def __oct__(self): + return $0 diff --git a/python-mode/__or__ b/python-mode/__or__ new file mode 100644 index 000000000..6c14ea720 --- /dev/null +++ b/python-mode/__or__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __or__ +# key: __or__ +# group: Special methods +# -- +def __or__(self, other): + return $0 diff --git a/python-mode/__pos__ b/python-mode/__pos__ new file mode 100644 index 000000000..ac429b86d --- /dev/null +++ b/python-mode/__pos__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __pos__ +# key: __pos__ +# group: Special methods +# -- +def __pos__(self): + return $0 diff --git a/python-mode/__pow__ b/python-mode/__pow__ new file mode 100644 index 000000000..c79910233 --- /dev/null +++ b/python-mode/__pow__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __pow__ +# key: __pow__ +# group: Special methods +# -- +def __pow__(self, other, modulo=None): + return $0 diff --git a/python-mode/__radd__ b/python-mode/__radd__ new file mode 100644 index 000000000..761d63d88 --- /dev/null +++ b/python-mode/__radd__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __radd__ +# key: __radd__ +# group: Special methods +# -- +def __radd__(self, other): + return $0 diff --git a/python-mode/__rand__ b/python-mode/__rand__ new file mode 100644 index 000000000..be85670a4 --- /dev/null +++ b/python-mode/__rand__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rand__ +# key: __rand__ +# group: Special methods +# -- +def __rand__(self, other): + return $0 diff --git a/python-mode/__rdivmod__ b/python-mode/__rdivmod__ new file mode 100644 index 000000000..2c06a8737 --- /dev/null +++ b/python-mode/__rdivmod__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rdivmod__ +# key: __rdivmod__ +# group: Special methods +# -- +def __rdivmod__(self, other): + return $0 diff --git a/python-mode/__repr__ b/python-mode/__repr__ new file mode 100644 index 000000000..45ae2f9a1 --- /dev/null +++ b/python-mode/__repr__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __repr__ +# key: __repr__ +# group: Special methods +# -- +def __repr__(self): + return $0 diff --git a/python-mode/__reversed__ b/python-mode/__reversed__ new file mode 100644 index 000000000..8f29b7bcb --- /dev/null +++ b/python-mode/__reversed__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __reversed__ +# key: __reversed__ +# group: Special methods +# -- +def __reversed__(self): + return $0 diff --git a/python-mode/__rfloordiv__ b/python-mode/__rfloordiv__ new file mode 100644 index 000000000..317aeefab --- /dev/null +++ b/python-mode/__rfloordiv__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rfloordiv__ +# key: __rfloordiv__ +# group: Special methods +# -- +def __rfloordiv__(self, other): + return $0 diff --git a/python-mode/__rlshift__ b/python-mode/__rlshift__ new file mode 100644 index 000000000..5522f8532 --- /dev/null +++ b/python-mode/__rlshift__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rlshift__ +# key: __rlshift__ +# group: Special methods +# -- +def __rlshift__(self, other): + return $0 diff --git a/python-mode/__rmod__ b/python-mode/__rmod__ new file mode 100644 index 000000000..562c07f6b --- /dev/null +++ b/python-mode/__rmod__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rmod__ +# key: __rmod__ +# group: Special methods +# -- +def __rmod__(self, other): + return $0 diff --git a/python-mode/__rmul__ b/python-mode/__rmul__ new file mode 100644 index 000000000..aae0b45fc --- /dev/null +++ b/python-mode/__rmul__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rmul__ +# key: __rmul__ +# group: Special methods +# -- +def __rmul__(self, other): + return $0 diff --git a/python-mode/__ror__ b/python-mode/__ror__ new file mode 100644 index 000000000..07895497c --- /dev/null +++ b/python-mode/__ror__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ror__ +# key: __ror__ +# group: Special methods +# -- +def __ror__(self, other): + return $0 diff --git a/python-mode/__rpow__ b/python-mode/__rpow__ new file mode 100644 index 000000000..7253b2e69 --- /dev/null +++ b/python-mode/__rpow__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rpow__ +# key: __rpow__ +# group: Special methods +# -- +def __rpow__(self, other): + return $0 diff --git a/python-mode/__rrshift__ b/python-mode/__rrshift__ new file mode 100644 index 000000000..5d62907d9 --- /dev/null +++ b/python-mode/__rrshift__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rrshift__ +# key: __rrshift__ +# group: Special methods +# -- +def __rrshift__(self, other): + return $0 diff --git a/python-mode/__rshift__ b/python-mode/__rshift__ new file mode 100644 index 000000000..1ec6af275 --- /dev/null +++ b/python-mode/__rshift__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rshift__ +# key: __rshift__ +# group: Special methods +# -- +def __rshift__(self, other): + return $0 diff --git a/python-mode/__rsub__ b/python-mode/__rsub__ new file mode 100644 index 000000000..d58d7e815 --- /dev/null +++ b/python-mode/__rsub__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rsub__ +# key: __rsub__ +# group: Special methods +# -- +def __rsub__(self, other): + return $0 diff --git a/python-mode/__rtruediv__ b/python-mode/__rtruediv__ new file mode 100644 index 000000000..993d117aa --- /dev/null +++ b/python-mode/__rtruediv__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rtruediv__ +# key: __rtruediv__ +# group: Special methods +# -- +def __rtruediv__(self, other): + return $0 diff --git a/python-mode/__rxor__ b/python-mode/__rxor__ new file mode 100644 index 000000000..4d1cc09fb --- /dev/null +++ b/python-mode/__rxor__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rxor__ +# key: __rxor__ +# group: Special methods +# -- +def __rxor__(self, other): + return $0 diff --git a/python-mode/__set__ b/python-mode/__set__ new file mode 100644 index 000000000..bf87f574c --- /dev/null +++ b/python-mode/__set__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __set__ +# key: __set__ +# group: Special methods +# -- +def __set__(self, instance, value): + $0 diff --git a/python-mode/__setattr__ b/python-mode/__setattr__ new file mode 100644 index 000000000..3482e8e2f --- /dev/null +++ b/python-mode/__setattr__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __setattr__ +# key: __setattr__ +# group: Special methods +# -- +def __setattr__(self, name, value): + $0 diff --git a/python-mode/__setitem__ b/python-mode/__setitem__ new file mode 100644 index 000000000..d229fa16b --- /dev/null +++ b/python-mode/__setitem__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __setitem__ +# key: __setitem__ +# group: Special methods +# -- +def __setitem__(self, key, value): + $0 diff --git a/python-mode/__slots__ b/python-mode/__slots__ new file mode 100644 index 000000000..c35d4880b --- /dev/null +++ b/python-mode/__slots__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __slots__ +# key: __slots__ +# group: Class attributes +# -- +__slots__ = ($1) +$0 diff --git a/python-mode/__str__ b/python-mode/__str__ new file mode 100644 index 000000000..3b3908881 --- /dev/null +++ b/python-mode/__str__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __str__ +# key: __str__ +# group: Special methods +# -- +def __str__(self): + return $0 diff --git a/python-mode/__sub__ b/python-mode/__sub__ new file mode 100644 index 000000000..a18345903 --- /dev/null +++ b/python-mode/__sub__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __sub__ +# key: __sub__ +# group: Special methods +# -- +def __sub__(self, other): + return $0 diff --git a/python-mode/__subclasscheck__ b/python-mode/__subclasscheck__ new file mode 100644 index 000000000..3918b4cae --- /dev/null +++ b/python-mode/__subclasscheck__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __subclasscheck__ +# key: __subclasscheck__ +# group: Special methods +# -- +def __subclasscheck__(self, instance): + return $0 diff --git a/python-mode/__truediv__ b/python-mode/__truediv__ new file mode 100644 index 000000000..c76e0553d --- /dev/null +++ b/python-mode/__truediv__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __truediv__ +# key: __truediv__ +# group: Special methods +# -- +def __truediv__(self, other): + return $0 diff --git a/python-mode/__unicode__ b/python-mode/__unicode__ new file mode 100644 index 000000000..62b82f661 --- /dev/null +++ b/python-mode/__unicode__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __unicode__ +# key: __unicode__ +# group: Special methods +# -- +def __unicode__(self): + return $0 diff --git a/python-mode/__xor__ b/python-mode/__xor__ new file mode 100644 index 000000000..3c7e694bb --- /dev/null +++ b/python-mode/__xor__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __xor__ +# key: __xor__ +# group: Special methods +# -- +def __xor__(self, other): + return $0 diff --git a/python-mode/ase b/python-mode/ase new file mode 100644 index 000000000..82389db5d --- /dev/null +++ b/python-mode/ase @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: Assert Equal +# key: ase +# group: Testing +# -- +self.assertEqual(${1:expected}, ${2:actual}) diff --git a/python-mode/asne b/python-mode/asne new file mode 100644 index 000000000..7e766b6cb --- /dev/null +++ b/python-mode/asne @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: Assert Not Equal +# key: asne +# group: Testing +# -- +self.assertNotEqual(${1:expected}, ${2:actual}) diff --git a/python-mode/asr b/python-mode/asr new file mode 100644 index 000000000..8aafd05cf --- /dev/null +++ b/python-mode/asr @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Assert Raises +# key: asr +# group: Testing +# -- +with self.assertRaises(${1:Exception}): + $0 diff --git a/python-mode/class b/python-mode/class new file mode 100644 index 000000000..eb6f1f1ff --- /dev/null +++ b/python-mode/class @@ -0,0 +1,13 @@ +# -*- mode: snippet -*- +# name: class(parent): ... +# key: class +# group: Definitions +# -- +class ${1:ClassName}(${2:object}): + """${3:Documentation for $1} + + """ + def __init__(self${4:, args}): + super($1, self).__init__($5) + ${4:$(elpy-snippet-init-assignments text)} + $0 \ No newline at end of file diff --git a/python-mode/defs b/python-mode/defs new file mode 100644 index 000000000..974ef404a --- /dev/null +++ b/python-mode/defs @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: def method(self, ...): +# key: defs +# group: Definitions +# -- +def ${1:methodname}(self, ${2:arg}): + ${3:pass} diff --git a/python-mode/enc b/python-mode/enc new file mode 100644 index 000000000..54aeebcf5 --- /dev/null +++ b/python-mode/enc @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: # coding: utf-8 +# key: enc +# group: Header +# -- +# coding: utf-8 diff --git a/python-mode/env b/python-mode/env new file mode 100644 index 000000000..d4fb804ab --- /dev/null +++ b/python-mode/env @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: #!/usr/bin/env python +# key: env +# group: Header +# -- +#!/usr/bin/env python diff --git a/python-mode/from b/python-mode/from new file mode 100644 index 000000000..0a706eb37 --- /dev/null +++ b/python-mode/from @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: from MOD import SYM +# key: from +# group: Header +# -- +from ${1:module} import ${2:symbol} +$0 \ No newline at end of file diff --git a/python-mode/pdb b/python-mode/pdb new file mode 100644 index 000000000..ed673a35e --- /dev/null +++ b/python-mode/pdb @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: pdb.set_trace() +# key: pdb +# group: Debug +# -- +import pdb; pdb.set_trace() diff --git a/python-mode/py3 b/python-mode/py3 new file mode 100644 index 000000000..ae8eb7b8c --- /dev/null +++ b/python-mode/py3 @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: from __future__ import ... +# key: py3 +# group: Python 3 +# -- +from __future__ import division, absolute_import +from __future__ import print_function, unicode_literals diff --git a/python-mode/super b/python-mode/super index baf97fe80..3b4e0d90a 100644 --- a/python-mode/super +++ b/python-mode/super @@ -1,8 +1,7 @@ # -*- mode: snippet -*- -# name: super() call +# name: super() # key: super -# group: Class -# contributor: Jorgen Schaefer +# group: Definitions # -- super`(elpy-snippet-super-form)`(${1:`(elpy-snippet-super-arguments)`}) $0 \ No newline at end of file From 8a5dfb65bc7b42105dd21588f2aec9fe2322320c Mon Sep 17 00:00:00 2001 From: Jorgen Schaefer Date: Sat, 28 Jun 2014 11:01:25 +0200 Subject: [PATCH 04/16] Add __bool__ snippet. --- python-mode/__bool__ | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 python-mode/__bool__ diff --git a/python-mode/__bool__ b/python-mode/__bool__ new file mode 100644 index 000000000..ba4ffe85e --- /dev/null +++ b/python-mode/__bool__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __bool__ +# key: __bool__ +# group: Special methods +# -- +def __bool__(self): + return $0 From 4892b4a4f10d9058d00e3657907e5d76ebb5c98c Mon Sep 17 00:00:00 2001 From: Daniel Wu Date: Sat, 9 Aug 2014 07:50:11 -0400 Subject: [PATCH 05/16] updated yasnippet variable 'text' to 'yas-text' --- python-mode/__init__ | 2 +- python-mode/__new__ | 2 +- python-mode/class | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python-mode/__init__ b/python-mode/__init__ index 575256b08..e1f6cded1 100644 --- a/python-mode/__init__ +++ b/python-mode/__init__ @@ -7,4 +7,4 @@ def __init__(self${1:, args}): """$2 """ - ${1:$(elpy-snippet-init-assignments text)} + ${1:$(elpy-snippet-init-assignments yas-text)} diff --git a/python-mode/__new__ b/python-mode/__new__ index 01e788e63..aac14dcde 100644 --- a/python-mode/__new__ +++ b/python-mode/__new__ @@ -7,4 +7,4 @@ def __new__(cls${1:, args}): """$2 """ - ${1:$(elpy-snippet-init-assignments text)} + ${1:$(elpy-snippet-init-assignments yas-text)} diff --git a/python-mode/class b/python-mode/class index eb6f1f1ff..b5c180de7 100644 --- a/python-mode/class +++ b/python-mode/class @@ -9,5 +9,5 @@ class ${1:ClassName}(${2:object}): """ def __init__(self${4:, args}): super($1, self).__init__($5) - ${4:$(elpy-snippet-init-assignments text)} - $0 \ No newline at end of file + ${4:$(elpy-snippet-init-assignments yas-text)} + $0 From de359b0cfc722d4d7d024aa99994edf7c94ee97b Mon Sep 17 00:00:00 2001 From: Daniel Gopar Date: Wed, 20 Jan 2016 11:00:11 -0800 Subject: [PATCH 06/16] Return correct form of "super" depending on Python version Previously when using the yasnippet "super", it will always return "(class, arg).method" which was the Py2 way of doing it. In Py3, you could simply do "().method" and Python will understand. --- python-mode/.yas-setup.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/python-mode/.yas-setup.el b/python-mode/.yas-setup.el index c5283237a..5a9c691ea 100644 --- a/python-mode/.yas-setup.el +++ b/python-mode/.yas-setup.el @@ -47,13 +47,19 @@ ""))) (defun elpy-snippet-super-form () - "Return (Class, first-arg).method" + "Return (Class, first-arg).method if Py2. +Else return ().method for Py3." (let* ((defun-info (elpy-snippet-current-method-and-args)) (class (nth 0 defun-info)) (method (nth 1 defun-info)) (args (nth 2 defun-info)) - (first-arg (nth 0 args))) - (format "(%s, %s).%s" class first-arg method))) + (first-arg (nth 0 args)) + (py-version-command " -c 'import sys ; print(sys.version_info.major)'") + ;; Get the python version. Either 2 or 3 + (py-version-num (substring (shell-command-to-string (concat elpy-rpc-python-command py-version-command))0 1))) + (if (string-match py-version-num "2") + (format "(%s, %s).%s" class first-arg method) + (format "().%s" method)))) (defun elpy-snippet-super-arguments () "Return the argument list for the current method." From 003ac4371029b56cc4e383c9a64096236cd91db7 Mon Sep 17 00:00:00 2001 From: Nicholas D Steeves Date: Thu, 15 Mar 2018 19:40:04 -0400 Subject: [PATCH 07/16] Move yasnippet-snippets onto their own branch --- {python-mode => snippets/python-mode}/.yas-setup.el | 0 {python-mode => snippets/python-mode}/__abs__ | 0 {python-mode => snippets/python-mode}/__add__ | 0 {python-mode => snippets/python-mode}/__and__ | 0 {python-mode => snippets/python-mode}/__bool__ | 0 {python-mode => snippets/python-mode}/__call__ | 0 {python-mode => snippets/python-mode}/__cmp__ | 0 {python-mode => snippets/python-mode}/__coerce__ | 0 {python-mode => snippets/python-mode}/__complex__ | 0 {python-mode => snippets/python-mode}/__contains__ | 0 {python-mode => snippets/python-mode}/__del__ | 0 {python-mode => snippets/python-mode}/__delattr__ | 0 {python-mode => snippets/python-mode}/__delete__ | 0 {python-mode => snippets/python-mode}/__delitem__ | 0 {python-mode => snippets/python-mode}/__div__ | 0 {python-mode => snippets/python-mode}/__divmod__ | 0 {python-mode => snippets/python-mode}/__enter__ | 0 {python-mode => snippets/python-mode}/__eq__ | 0 {python-mode => snippets/python-mode}/__exit__ | 0 {python-mode => snippets/python-mode}/__float__ | 0 {python-mode => snippets/python-mode}/__floordiv__ | 0 {python-mode => snippets/python-mode}/__ge__ | 0 {python-mode => snippets/python-mode}/__get__ | 0 {python-mode => snippets/python-mode}/__getattr__ | 0 {python-mode => snippets/python-mode}/__getattribute__ | 0 {python-mode => snippets/python-mode}/__getitem__ | 0 {python-mode => snippets/python-mode}/__gt__ | 0 {python-mode => snippets/python-mode}/__hash__ | 0 {python-mode => snippets/python-mode}/__hex__ | 0 {python-mode => snippets/python-mode}/__iadd__ | 0 {python-mode => snippets/python-mode}/__iand__ | 0 {python-mode => snippets/python-mode}/__idiv__ | 0 {python-mode => snippets/python-mode}/__ifloordiv__ | 0 {python-mode => snippets/python-mode}/__ilshift__ | 0 {python-mode => snippets/python-mode}/__imod__ | 0 {python-mode => snippets/python-mode}/__imul__ | 0 {python-mode => snippets/python-mode}/__index__ | 0 {python-mode => snippets/python-mode}/__init__ | 0 {python-mode => snippets/python-mode}/__instancecheck__ | 0 {python-mode => snippets/python-mode}/__int__ | 0 {python-mode => snippets/python-mode}/__invert__ | 0 {python-mode => snippets/python-mode}/__ior__ | 0 {python-mode => snippets/python-mode}/__ipow__ | 0 {python-mode => snippets/python-mode}/__irshift__ | 0 {python-mode => snippets/python-mode}/__isub__ | 0 {python-mode => snippets/python-mode}/__iter__ | 0 {python-mode => snippets/python-mode}/__itruediv__ | 0 {python-mode => snippets/python-mode}/__ixor__ | 0 {python-mode => snippets/python-mode}/__le__ | 0 {python-mode => snippets/python-mode}/__len__ | 0 {python-mode => snippets/python-mode}/__long__ | 0 {python-mode => snippets/python-mode}/__lshift__ | 0 {python-mode => snippets/python-mode}/__lt__ | 0 {python-mode => snippets/python-mode}/__mod__ | 0 {python-mode => snippets/python-mode}/__mul__ | 0 {python-mode => snippets/python-mode}/__ne__ | 0 {python-mode => snippets/python-mode}/__neg__ | 0 {python-mode => snippets/python-mode}/__new__ | 0 {python-mode => snippets/python-mode}/__nonzero__ | 0 {python-mode => snippets/python-mode}/__oct__ | 0 {python-mode => snippets/python-mode}/__or__ | 0 {python-mode => snippets/python-mode}/__pos__ | 0 {python-mode => snippets/python-mode}/__pow__ | 0 {python-mode => snippets/python-mode}/__radd__ | 0 {python-mode => snippets/python-mode}/__rand__ | 0 {python-mode => snippets/python-mode}/__rdivmod__ | 0 {python-mode => snippets/python-mode}/__repr__ | 0 {python-mode => snippets/python-mode}/__reversed__ | 0 {python-mode => snippets/python-mode}/__rfloordiv__ | 0 {python-mode => snippets/python-mode}/__rlshift__ | 0 {python-mode => snippets/python-mode}/__rmod__ | 0 {python-mode => snippets/python-mode}/__rmul__ | 0 {python-mode => snippets/python-mode}/__ror__ | 0 {python-mode => snippets/python-mode}/__rpow__ | 0 {python-mode => snippets/python-mode}/__rrshift__ | 0 {python-mode => snippets/python-mode}/__rshift__ | 0 {python-mode => snippets/python-mode}/__rsub__ | 0 {python-mode => snippets/python-mode}/__rtruediv__ | 0 {python-mode => snippets/python-mode}/__rxor__ | 0 {python-mode => snippets/python-mode}/__set__ | 0 {python-mode => snippets/python-mode}/__setattr__ | 0 {python-mode => snippets/python-mode}/__setitem__ | 0 {python-mode => snippets/python-mode}/__slots__ | 0 {python-mode => snippets/python-mode}/__str__ | 0 {python-mode => snippets/python-mode}/__sub__ | 0 {python-mode => snippets/python-mode}/__subclasscheck__ | 0 {python-mode => snippets/python-mode}/__truediv__ | 0 {python-mode => snippets/python-mode}/__unicode__ | 0 {python-mode => snippets/python-mode}/__xor__ | 0 {python-mode => snippets/python-mode}/ase | 0 {python-mode => snippets/python-mode}/asne | 0 {python-mode => snippets/python-mode}/asr | 0 {python-mode => snippets/python-mode}/class | 0 {python-mode => snippets/python-mode}/defs | 0 {python-mode => snippets/python-mode}/enc | 0 {python-mode => snippets/python-mode}/env | 0 {python-mode => snippets/python-mode}/from | 0 {python-mode => snippets/python-mode}/pdb | 0 {python-mode => snippets/python-mode}/py3 | 0 {python-mode => snippets/python-mode}/super | 0 100 files changed, 0 insertions(+), 0 deletions(-) rename {python-mode => snippets/python-mode}/.yas-setup.el (100%) rename {python-mode => snippets/python-mode}/__abs__ (100%) rename {python-mode => snippets/python-mode}/__add__ (100%) rename {python-mode => snippets/python-mode}/__and__ (100%) rename {python-mode => snippets/python-mode}/__bool__ (100%) rename {python-mode => snippets/python-mode}/__call__ (100%) rename {python-mode => snippets/python-mode}/__cmp__ (100%) rename {python-mode => snippets/python-mode}/__coerce__ (100%) rename {python-mode => snippets/python-mode}/__complex__ (100%) rename {python-mode => snippets/python-mode}/__contains__ (100%) rename {python-mode => snippets/python-mode}/__del__ (100%) rename {python-mode => snippets/python-mode}/__delattr__ (100%) rename {python-mode => snippets/python-mode}/__delete__ (100%) rename {python-mode => snippets/python-mode}/__delitem__ (100%) rename {python-mode => snippets/python-mode}/__div__ (100%) rename {python-mode => snippets/python-mode}/__divmod__ (100%) rename {python-mode => snippets/python-mode}/__enter__ (100%) rename {python-mode => snippets/python-mode}/__eq__ (100%) rename {python-mode => snippets/python-mode}/__exit__ (100%) rename {python-mode => snippets/python-mode}/__float__ (100%) rename {python-mode => snippets/python-mode}/__floordiv__ (100%) rename {python-mode => snippets/python-mode}/__ge__ (100%) rename {python-mode => snippets/python-mode}/__get__ (100%) rename {python-mode => snippets/python-mode}/__getattr__ (100%) rename {python-mode => snippets/python-mode}/__getattribute__ (100%) rename {python-mode => snippets/python-mode}/__getitem__ (100%) rename {python-mode => snippets/python-mode}/__gt__ (100%) rename {python-mode => snippets/python-mode}/__hash__ (100%) rename {python-mode => snippets/python-mode}/__hex__ (100%) rename {python-mode => snippets/python-mode}/__iadd__ (100%) rename {python-mode => snippets/python-mode}/__iand__ (100%) rename {python-mode => snippets/python-mode}/__idiv__ (100%) rename {python-mode => snippets/python-mode}/__ifloordiv__ (100%) rename {python-mode => snippets/python-mode}/__ilshift__ (100%) rename {python-mode => snippets/python-mode}/__imod__ (100%) rename {python-mode => snippets/python-mode}/__imul__ (100%) rename {python-mode => snippets/python-mode}/__index__ (100%) rename {python-mode => snippets/python-mode}/__init__ (100%) rename {python-mode => snippets/python-mode}/__instancecheck__ (100%) rename {python-mode => snippets/python-mode}/__int__ (100%) rename {python-mode => snippets/python-mode}/__invert__ (100%) rename {python-mode => snippets/python-mode}/__ior__ (100%) rename {python-mode => snippets/python-mode}/__ipow__ (100%) rename {python-mode => snippets/python-mode}/__irshift__ (100%) rename {python-mode => snippets/python-mode}/__isub__ (100%) rename {python-mode => snippets/python-mode}/__iter__ (100%) rename {python-mode => snippets/python-mode}/__itruediv__ (100%) rename {python-mode => snippets/python-mode}/__ixor__ (100%) rename {python-mode => snippets/python-mode}/__le__ (100%) rename {python-mode => snippets/python-mode}/__len__ (100%) rename {python-mode => snippets/python-mode}/__long__ (100%) rename {python-mode => snippets/python-mode}/__lshift__ (100%) rename {python-mode => snippets/python-mode}/__lt__ (100%) rename {python-mode => snippets/python-mode}/__mod__ (100%) rename {python-mode => snippets/python-mode}/__mul__ (100%) rename {python-mode => snippets/python-mode}/__ne__ (100%) rename {python-mode => snippets/python-mode}/__neg__ (100%) rename {python-mode => snippets/python-mode}/__new__ (100%) rename {python-mode => snippets/python-mode}/__nonzero__ (100%) rename {python-mode => snippets/python-mode}/__oct__ (100%) rename {python-mode => snippets/python-mode}/__or__ (100%) rename {python-mode => snippets/python-mode}/__pos__ (100%) rename {python-mode => snippets/python-mode}/__pow__ (100%) rename {python-mode => snippets/python-mode}/__radd__ (100%) rename {python-mode => snippets/python-mode}/__rand__ (100%) rename {python-mode => snippets/python-mode}/__rdivmod__ (100%) rename {python-mode => snippets/python-mode}/__repr__ (100%) rename {python-mode => snippets/python-mode}/__reversed__ (100%) rename {python-mode => snippets/python-mode}/__rfloordiv__ (100%) rename {python-mode => snippets/python-mode}/__rlshift__ (100%) rename {python-mode => snippets/python-mode}/__rmod__ (100%) rename {python-mode => snippets/python-mode}/__rmul__ (100%) rename {python-mode => snippets/python-mode}/__ror__ (100%) rename {python-mode => snippets/python-mode}/__rpow__ (100%) rename {python-mode => snippets/python-mode}/__rrshift__ (100%) rename {python-mode => snippets/python-mode}/__rshift__ (100%) rename {python-mode => snippets/python-mode}/__rsub__ (100%) rename {python-mode => snippets/python-mode}/__rtruediv__ (100%) rename {python-mode => snippets/python-mode}/__rxor__ (100%) rename {python-mode => snippets/python-mode}/__set__ (100%) rename {python-mode => snippets/python-mode}/__setattr__ (100%) rename {python-mode => snippets/python-mode}/__setitem__ (100%) rename {python-mode => snippets/python-mode}/__slots__ (100%) rename {python-mode => snippets/python-mode}/__str__ (100%) rename {python-mode => snippets/python-mode}/__sub__ (100%) rename {python-mode => snippets/python-mode}/__subclasscheck__ (100%) rename {python-mode => snippets/python-mode}/__truediv__ (100%) rename {python-mode => snippets/python-mode}/__unicode__ (100%) rename {python-mode => snippets/python-mode}/__xor__ (100%) rename {python-mode => snippets/python-mode}/ase (100%) rename {python-mode => snippets/python-mode}/asne (100%) rename {python-mode => snippets/python-mode}/asr (100%) rename {python-mode => snippets/python-mode}/class (100%) rename {python-mode => snippets/python-mode}/defs (100%) rename {python-mode => snippets/python-mode}/enc (100%) rename {python-mode => snippets/python-mode}/env (100%) rename {python-mode => snippets/python-mode}/from (100%) rename {python-mode => snippets/python-mode}/pdb (100%) rename {python-mode => snippets/python-mode}/py3 (100%) rename {python-mode => snippets/python-mode}/super (100%) diff --git a/python-mode/.yas-setup.el b/snippets/python-mode/.yas-setup.el similarity index 100% rename from python-mode/.yas-setup.el rename to snippets/python-mode/.yas-setup.el diff --git a/python-mode/__abs__ b/snippets/python-mode/__abs__ similarity index 100% rename from python-mode/__abs__ rename to snippets/python-mode/__abs__ diff --git a/python-mode/__add__ b/snippets/python-mode/__add__ similarity index 100% rename from python-mode/__add__ rename to snippets/python-mode/__add__ diff --git a/python-mode/__and__ b/snippets/python-mode/__and__ similarity index 100% rename from python-mode/__and__ rename to snippets/python-mode/__and__ diff --git a/python-mode/__bool__ b/snippets/python-mode/__bool__ similarity index 100% rename from python-mode/__bool__ rename to snippets/python-mode/__bool__ diff --git a/python-mode/__call__ b/snippets/python-mode/__call__ similarity index 100% rename from python-mode/__call__ rename to snippets/python-mode/__call__ diff --git a/python-mode/__cmp__ b/snippets/python-mode/__cmp__ similarity index 100% rename from python-mode/__cmp__ rename to snippets/python-mode/__cmp__ diff --git a/python-mode/__coerce__ b/snippets/python-mode/__coerce__ similarity index 100% rename from python-mode/__coerce__ rename to snippets/python-mode/__coerce__ diff --git a/python-mode/__complex__ b/snippets/python-mode/__complex__ similarity index 100% rename from python-mode/__complex__ rename to snippets/python-mode/__complex__ diff --git a/python-mode/__contains__ b/snippets/python-mode/__contains__ similarity index 100% rename from python-mode/__contains__ rename to snippets/python-mode/__contains__ diff --git a/python-mode/__del__ b/snippets/python-mode/__del__ similarity index 100% rename from python-mode/__del__ rename to snippets/python-mode/__del__ diff --git a/python-mode/__delattr__ b/snippets/python-mode/__delattr__ similarity index 100% rename from python-mode/__delattr__ rename to snippets/python-mode/__delattr__ diff --git a/python-mode/__delete__ b/snippets/python-mode/__delete__ similarity index 100% rename from python-mode/__delete__ rename to snippets/python-mode/__delete__ diff --git a/python-mode/__delitem__ b/snippets/python-mode/__delitem__ similarity index 100% rename from python-mode/__delitem__ rename to snippets/python-mode/__delitem__ diff --git a/python-mode/__div__ b/snippets/python-mode/__div__ similarity index 100% rename from python-mode/__div__ rename to snippets/python-mode/__div__ diff --git a/python-mode/__divmod__ b/snippets/python-mode/__divmod__ similarity index 100% rename from python-mode/__divmod__ rename to snippets/python-mode/__divmod__ diff --git a/python-mode/__enter__ b/snippets/python-mode/__enter__ similarity index 100% rename from python-mode/__enter__ rename to snippets/python-mode/__enter__ diff --git a/python-mode/__eq__ b/snippets/python-mode/__eq__ similarity index 100% rename from python-mode/__eq__ rename to snippets/python-mode/__eq__ diff --git a/python-mode/__exit__ b/snippets/python-mode/__exit__ similarity index 100% rename from python-mode/__exit__ rename to snippets/python-mode/__exit__ diff --git a/python-mode/__float__ b/snippets/python-mode/__float__ similarity index 100% rename from python-mode/__float__ rename to snippets/python-mode/__float__ diff --git a/python-mode/__floordiv__ b/snippets/python-mode/__floordiv__ similarity index 100% rename from python-mode/__floordiv__ rename to snippets/python-mode/__floordiv__ diff --git a/python-mode/__ge__ b/snippets/python-mode/__ge__ similarity index 100% rename from python-mode/__ge__ rename to snippets/python-mode/__ge__ diff --git a/python-mode/__get__ b/snippets/python-mode/__get__ similarity index 100% rename from python-mode/__get__ rename to snippets/python-mode/__get__ diff --git a/python-mode/__getattr__ b/snippets/python-mode/__getattr__ similarity index 100% rename from python-mode/__getattr__ rename to snippets/python-mode/__getattr__ diff --git a/python-mode/__getattribute__ b/snippets/python-mode/__getattribute__ similarity index 100% rename from python-mode/__getattribute__ rename to snippets/python-mode/__getattribute__ diff --git a/python-mode/__getitem__ b/snippets/python-mode/__getitem__ similarity index 100% rename from python-mode/__getitem__ rename to snippets/python-mode/__getitem__ diff --git a/python-mode/__gt__ b/snippets/python-mode/__gt__ similarity index 100% rename from python-mode/__gt__ rename to snippets/python-mode/__gt__ diff --git a/python-mode/__hash__ b/snippets/python-mode/__hash__ similarity index 100% rename from python-mode/__hash__ rename to snippets/python-mode/__hash__ diff --git a/python-mode/__hex__ b/snippets/python-mode/__hex__ similarity index 100% rename from python-mode/__hex__ rename to snippets/python-mode/__hex__ diff --git a/python-mode/__iadd__ b/snippets/python-mode/__iadd__ similarity index 100% rename from python-mode/__iadd__ rename to snippets/python-mode/__iadd__ diff --git a/python-mode/__iand__ b/snippets/python-mode/__iand__ similarity index 100% rename from python-mode/__iand__ rename to snippets/python-mode/__iand__ diff --git a/python-mode/__idiv__ b/snippets/python-mode/__idiv__ similarity index 100% rename from python-mode/__idiv__ rename to snippets/python-mode/__idiv__ diff --git a/python-mode/__ifloordiv__ b/snippets/python-mode/__ifloordiv__ similarity index 100% rename from python-mode/__ifloordiv__ rename to snippets/python-mode/__ifloordiv__ diff --git a/python-mode/__ilshift__ b/snippets/python-mode/__ilshift__ similarity index 100% rename from python-mode/__ilshift__ rename to snippets/python-mode/__ilshift__ diff --git a/python-mode/__imod__ b/snippets/python-mode/__imod__ similarity index 100% rename from python-mode/__imod__ rename to snippets/python-mode/__imod__ diff --git a/python-mode/__imul__ b/snippets/python-mode/__imul__ similarity index 100% rename from python-mode/__imul__ rename to snippets/python-mode/__imul__ diff --git a/python-mode/__index__ b/snippets/python-mode/__index__ similarity index 100% rename from python-mode/__index__ rename to snippets/python-mode/__index__ diff --git a/python-mode/__init__ b/snippets/python-mode/__init__ similarity index 100% rename from python-mode/__init__ rename to snippets/python-mode/__init__ diff --git a/python-mode/__instancecheck__ b/snippets/python-mode/__instancecheck__ similarity index 100% rename from python-mode/__instancecheck__ rename to snippets/python-mode/__instancecheck__ diff --git a/python-mode/__int__ b/snippets/python-mode/__int__ similarity index 100% rename from python-mode/__int__ rename to snippets/python-mode/__int__ diff --git a/python-mode/__invert__ b/snippets/python-mode/__invert__ similarity index 100% rename from python-mode/__invert__ rename to snippets/python-mode/__invert__ diff --git a/python-mode/__ior__ b/snippets/python-mode/__ior__ similarity index 100% rename from python-mode/__ior__ rename to snippets/python-mode/__ior__ diff --git a/python-mode/__ipow__ b/snippets/python-mode/__ipow__ similarity index 100% rename from python-mode/__ipow__ rename to snippets/python-mode/__ipow__ diff --git a/python-mode/__irshift__ b/snippets/python-mode/__irshift__ similarity index 100% rename from python-mode/__irshift__ rename to snippets/python-mode/__irshift__ diff --git a/python-mode/__isub__ b/snippets/python-mode/__isub__ similarity index 100% rename from python-mode/__isub__ rename to snippets/python-mode/__isub__ diff --git a/python-mode/__iter__ b/snippets/python-mode/__iter__ similarity index 100% rename from python-mode/__iter__ rename to snippets/python-mode/__iter__ diff --git a/python-mode/__itruediv__ b/snippets/python-mode/__itruediv__ similarity index 100% rename from python-mode/__itruediv__ rename to snippets/python-mode/__itruediv__ diff --git a/python-mode/__ixor__ b/snippets/python-mode/__ixor__ similarity index 100% rename from python-mode/__ixor__ rename to snippets/python-mode/__ixor__ diff --git a/python-mode/__le__ b/snippets/python-mode/__le__ similarity index 100% rename from python-mode/__le__ rename to snippets/python-mode/__le__ diff --git a/python-mode/__len__ b/snippets/python-mode/__len__ similarity index 100% rename from python-mode/__len__ rename to snippets/python-mode/__len__ diff --git a/python-mode/__long__ b/snippets/python-mode/__long__ similarity index 100% rename from python-mode/__long__ rename to snippets/python-mode/__long__ diff --git a/python-mode/__lshift__ b/snippets/python-mode/__lshift__ similarity index 100% rename from python-mode/__lshift__ rename to snippets/python-mode/__lshift__ diff --git a/python-mode/__lt__ b/snippets/python-mode/__lt__ similarity index 100% rename from python-mode/__lt__ rename to snippets/python-mode/__lt__ diff --git a/python-mode/__mod__ b/snippets/python-mode/__mod__ similarity index 100% rename from python-mode/__mod__ rename to snippets/python-mode/__mod__ diff --git a/python-mode/__mul__ b/snippets/python-mode/__mul__ similarity index 100% rename from python-mode/__mul__ rename to snippets/python-mode/__mul__ diff --git a/python-mode/__ne__ b/snippets/python-mode/__ne__ similarity index 100% rename from python-mode/__ne__ rename to snippets/python-mode/__ne__ diff --git a/python-mode/__neg__ b/snippets/python-mode/__neg__ similarity index 100% rename from python-mode/__neg__ rename to snippets/python-mode/__neg__ diff --git a/python-mode/__new__ b/snippets/python-mode/__new__ similarity index 100% rename from python-mode/__new__ rename to snippets/python-mode/__new__ diff --git a/python-mode/__nonzero__ b/snippets/python-mode/__nonzero__ similarity index 100% rename from python-mode/__nonzero__ rename to snippets/python-mode/__nonzero__ diff --git a/python-mode/__oct__ b/snippets/python-mode/__oct__ similarity index 100% rename from python-mode/__oct__ rename to snippets/python-mode/__oct__ diff --git a/python-mode/__or__ b/snippets/python-mode/__or__ similarity index 100% rename from python-mode/__or__ rename to snippets/python-mode/__or__ diff --git a/python-mode/__pos__ b/snippets/python-mode/__pos__ similarity index 100% rename from python-mode/__pos__ rename to snippets/python-mode/__pos__ diff --git a/python-mode/__pow__ b/snippets/python-mode/__pow__ similarity index 100% rename from python-mode/__pow__ rename to snippets/python-mode/__pow__ diff --git a/python-mode/__radd__ b/snippets/python-mode/__radd__ similarity index 100% rename from python-mode/__radd__ rename to snippets/python-mode/__radd__ diff --git a/python-mode/__rand__ b/snippets/python-mode/__rand__ similarity index 100% rename from python-mode/__rand__ rename to snippets/python-mode/__rand__ diff --git a/python-mode/__rdivmod__ b/snippets/python-mode/__rdivmod__ similarity index 100% rename from python-mode/__rdivmod__ rename to snippets/python-mode/__rdivmod__ diff --git a/python-mode/__repr__ b/snippets/python-mode/__repr__ similarity index 100% rename from python-mode/__repr__ rename to snippets/python-mode/__repr__ diff --git a/python-mode/__reversed__ b/snippets/python-mode/__reversed__ similarity index 100% rename from python-mode/__reversed__ rename to snippets/python-mode/__reversed__ diff --git a/python-mode/__rfloordiv__ b/snippets/python-mode/__rfloordiv__ similarity index 100% rename from python-mode/__rfloordiv__ rename to snippets/python-mode/__rfloordiv__ diff --git a/python-mode/__rlshift__ b/snippets/python-mode/__rlshift__ similarity index 100% rename from python-mode/__rlshift__ rename to snippets/python-mode/__rlshift__ diff --git a/python-mode/__rmod__ b/snippets/python-mode/__rmod__ similarity index 100% rename from python-mode/__rmod__ rename to snippets/python-mode/__rmod__ diff --git a/python-mode/__rmul__ b/snippets/python-mode/__rmul__ similarity index 100% rename from python-mode/__rmul__ rename to snippets/python-mode/__rmul__ diff --git a/python-mode/__ror__ b/snippets/python-mode/__ror__ similarity index 100% rename from python-mode/__ror__ rename to snippets/python-mode/__ror__ diff --git a/python-mode/__rpow__ b/snippets/python-mode/__rpow__ similarity index 100% rename from python-mode/__rpow__ rename to snippets/python-mode/__rpow__ diff --git a/python-mode/__rrshift__ b/snippets/python-mode/__rrshift__ similarity index 100% rename from python-mode/__rrshift__ rename to snippets/python-mode/__rrshift__ diff --git a/python-mode/__rshift__ b/snippets/python-mode/__rshift__ similarity index 100% rename from python-mode/__rshift__ rename to snippets/python-mode/__rshift__ diff --git a/python-mode/__rsub__ b/snippets/python-mode/__rsub__ similarity index 100% rename from python-mode/__rsub__ rename to snippets/python-mode/__rsub__ diff --git a/python-mode/__rtruediv__ b/snippets/python-mode/__rtruediv__ similarity index 100% rename from python-mode/__rtruediv__ rename to snippets/python-mode/__rtruediv__ diff --git a/python-mode/__rxor__ b/snippets/python-mode/__rxor__ similarity index 100% rename from python-mode/__rxor__ rename to snippets/python-mode/__rxor__ diff --git a/python-mode/__set__ b/snippets/python-mode/__set__ similarity index 100% rename from python-mode/__set__ rename to snippets/python-mode/__set__ diff --git a/python-mode/__setattr__ b/snippets/python-mode/__setattr__ similarity index 100% rename from python-mode/__setattr__ rename to snippets/python-mode/__setattr__ diff --git a/python-mode/__setitem__ b/snippets/python-mode/__setitem__ similarity index 100% rename from python-mode/__setitem__ rename to snippets/python-mode/__setitem__ diff --git a/python-mode/__slots__ b/snippets/python-mode/__slots__ similarity index 100% rename from python-mode/__slots__ rename to snippets/python-mode/__slots__ diff --git a/python-mode/__str__ b/snippets/python-mode/__str__ similarity index 100% rename from python-mode/__str__ rename to snippets/python-mode/__str__ diff --git a/python-mode/__sub__ b/snippets/python-mode/__sub__ similarity index 100% rename from python-mode/__sub__ rename to snippets/python-mode/__sub__ diff --git a/python-mode/__subclasscheck__ b/snippets/python-mode/__subclasscheck__ similarity index 100% rename from python-mode/__subclasscheck__ rename to snippets/python-mode/__subclasscheck__ diff --git a/python-mode/__truediv__ b/snippets/python-mode/__truediv__ similarity index 100% rename from python-mode/__truediv__ rename to snippets/python-mode/__truediv__ diff --git a/python-mode/__unicode__ b/snippets/python-mode/__unicode__ similarity index 100% rename from python-mode/__unicode__ rename to snippets/python-mode/__unicode__ diff --git a/python-mode/__xor__ b/snippets/python-mode/__xor__ similarity index 100% rename from python-mode/__xor__ rename to snippets/python-mode/__xor__ diff --git a/python-mode/ase b/snippets/python-mode/ase similarity index 100% rename from python-mode/ase rename to snippets/python-mode/ase diff --git a/python-mode/asne b/snippets/python-mode/asne similarity index 100% rename from python-mode/asne rename to snippets/python-mode/asne diff --git a/python-mode/asr b/snippets/python-mode/asr similarity index 100% rename from python-mode/asr rename to snippets/python-mode/asr diff --git a/python-mode/class b/snippets/python-mode/class similarity index 100% rename from python-mode/class rename to snippets/python-mode/class diff --git a/python-mode/defs b/snippets/python-mode/defs similarity index 100% rename from python-mode/defs rename to snippets/python-mode/defs diff --git a/python-mode/enc b/snippets/python-mode/enc similarity index 100% rename from python-mode/enc rename to snippets/python-mode/enc diff --git a/python-mode/env b/snippets/python-mode/env similarity index 100% rename from python-mode/env rename to snippets/python-mode/env diff --git a/python-mode/from b/snippets/python-mode/from similarity index 100% rename from python-mode/from rename to snippets/python-mode/from diff --git a/python-mode/pdb b/snippets/python-mode/pdb similarity index 100% rename from python-mode/pdb rename to snippets/python-mode/pdb diff --git a/python-mode/py3 b/snippets/python-mode/py3 similarity index 100% rename from python-mode/py3 rename to snippets/python-mode/py3 diff --git a/python-mode/super b/snippets/python-mode/super similarity index 100% rename from python-mode/super rename to snippets/python-mode/super From d0a328091d3efc3e8268a156ab0194f3615e7ac1 Mon Sep 17 00:00:00 2001 From: Nicholas D Steeves Date: Mon, 26 Mar 2018 11:50:49 -0400 Subject: [PATCH 08/16] Use snippet expansion for foo -> __foo__ --- snippets/python-mode/__abs__ | 2 +- snippets/python-mode/__add__ | 2 +- snippets/python-mode/__and__ | 2 +- snippets/python-mode/__bool__ | 2 +- snippets/python-mode/__call__ | 2 +- snippets/python-mode/__cmp__ | 2 +- snippets/python-mode/__coerce__ | 2 +- snippets/python-mode/__complex__ | 2 +- snippets/python-mode/__contains__ | 2 +- snippets/python-mode/__del__ | 2 +- snippets/python-mode/__delattr__ | 2 +- snippets/python-mode/__delete__ | 2 +- snippets/python-mode/__delitem__ | 2 +- snippets/python-mode/__div__ | 2 +- snippets/python-mode/__divmod__ | 2 +- snippets/python-mode/__enter__ | 2 +- snippets/python-mode/__eq__ | 2 +- snippets/python-mode/__exit__ | 2 +- snippets/python-mode/__float__ | 2 +- snippets/python-mode/__floordiv__ | 2 +- snippets/python-mode/__ge__ | 2 +- snippets/python-mode/__get__ | 2 +- snippets/python-mode/__getattr__ | 2 +- snippets/python-mode/__getattribute__ | 2 +- snippets/python-mode/__getitem__ | 2 +- snippets/python-mode/__gt__ | 2 +- snippets/python-mode/__hash__ | 2 +- snippets/python-mode/__hex__ | 2 +- snippets/python-mode/__iadd__ | 2 +- snippets/python-mode/__iand__ | 2 +- snippets/python-mode/__idiv__ | 2 +- snippets/python-mode/__ifloordiv__ | 2 +- snippets/python-mode/__ilshift__ | 2 +- snippets/python-mode/__imod__ | 2 +- snippets/python-mode/__imul__ | 2 +- snippets/python-mode/__index__ | 2 +- snippets/python-mode/__init__ | 2 +- snippets/python-mode/__instancecheck__ | 2 +- snippets/python-mode/__int__ | 2 +- snippets/python-mode/__invert__ | 2 +- snippets/python-mode/__ior__ | 2 +- snippets/python-mode/__ipow__ | 2 +- snippets/python-mode/__irshift__ | 2 +- snippets/python-mode/__isub__ | 2 +- snippets/python-mode/__iter__ | 2 +- snippets/python-mode/__itruediv__ | 2 +- snippets/python-mode/__ixor__ | 2 +- snippets/python-mode/__le__ | 2 +- snippets/python-mode/__len__ | 2 +- snippets/python-mode/__long__ | 2 +- snippets/python-mode/__lshift__ | 2 +- snippets/python-mode/__lt__ | 2 +- snippets/python-mode/__mod__ | 2 +- snippets/python-mode/__mul__ | 2 +- snippets/python-mode/__ne__ | 2 +- snippets/python-mode/__neg__ | 2 +- snippets/python-mode/__new__ | 2 +- snippets/python-mode/__nonzero__ | 2 +- snippets/python-mode/__oct__ | 2 +- snippets/python-mode/__or__ | 2 +- snippets/python-mode/__pos__ | 2 +- snippets/python-mode/__pow__ | 2 +- snippets/python-mode/__radd__ | 2 +- snippets/python-mode/__rand__ | 2 +- snippets/python-mode/__rdivmod__ | 2 +- snippets/python-mode/__repr__ | 2 +- snippets/python-mode/__reversed__ | 2 +- snippets/python-mode/__rfloordiv__ | 2 +- snippets/python-mode/__rlshift__ | 2 +- snippets/python-mode/__rmod__ | 2 +- snippets/python-mode/__rmul__ | 2 +- snippets/python-mode/__ror__ | 2 +- snippets/python-mode/__rpow__ | 2 +- snippets/python-mode/__rrshift__ | 2 +- snippets/python-mode/__rshift__ | 2 +- snippets/python-mode/__rsub__ | 2 +- snippets/python-mode/__rtruediv__ | 2 +- snippets/python-mode/__rxor__ | 2 +- snippets/python-mode/__set__ | 2 +- snippets/python-mode/__setattr__ | 2 +- snippets/python-mode/__setitem__ | 2 +- snippets/python-mode/__slots__ | 2 +- snippets/python-mode/__str__ | 2 +- snippets/python-mode/__sub__ | 2 +- snippets/python-mode/__subclasscheck__ | 2 +- snippets/python-mode/__truediv__ | 2 +- snippets/python-mode/__unicode__ | 2 +- snippets/python-mode/__xor__ | 2 +- 88 files changed, 88 insertions(+), 88 deletions(-) diff --git a/snippets/python-mode/__abs__ b/snippets/python-mode/__abs__ index 12b1585a5..a6cdedc6a 100644 --- a/snippets/python-mode/__abs__ +++ b/snippets/python-mode/__abs__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __abs__ -# key: __abs__ +# key: abs # group: Special methods # -- def __abs__(self): diff --git a/snippets/python-mode/__add__ b/snippets/python-mode/__add__ index a70f20f5e..016088634 100644 --- a/snippets/python-mode/__add__ +++ b/snippets/python-mode/__add__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __add__ -# key: __add__ +# key: add # group: Special methods # -- def __add__(self, other): diff --git a/snippets/python-mode/__and__ b/snippets/python-mode/__and__ index 56961d342..0e8141099 100644 --- a/snippets/python-mode/__and__ +++ b/snippets/python-mode/__and__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __and__ -# key: __and__ +# key: and # group: Special methods # -- def __and__(self, other): diff --git a/snippets/python-mode/__bool__ b/snippets/python-mode/__bool__ index ba4ffe85e..51df4528c 100644 --- a/snippets/python-mode/__bool__ +++ b/snippets/python-mode/__bool__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __bool__ -# key: __bool__ +# key: bool # group: Special methods # -- def __bool__(self): diff --git a/snippets/python-mode/__call__ b/snippets/python-mode/__call__ index dea846320..3631ead38 100644 --- a/snippets/python-mode/__call__ +++ b/snippets/python-mode/__call__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __call__ -# key: __call__ +# key: call # group: Special methods # -- def __call__(self, ${1:*args}): diff --git a/snippets/python-mode/__cmp__ b/snippets/python-mode/__cmp__ index c26662142..5a2de55d1 100644 --- a/snippets/python-mode/__cmp__ +++ b/snippets/python-mode/__cmp__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __cmp__ -# key: __cmp__ +# key: cmp # group: Special methods # -- def __cmp__(self, other): diff --git a/snippets/python-mode/__coerce__ b/snippets/python-mode/__coerce__ index 297138ca9..5d8d51b5a 100644 --- a/snippets/python-mode/__coerce__ +++ b/snippets/python-mode/__coerce__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __coerce__ -# key: __coerce__ +# key: coerce # group: Special methods # -- def __coerce__(self, other): diff --git a/snippets/python-mode/__complex__ b/snippets/python-mode/__complex__ index 108e47ecf..11a185030 100644 --- a/snippets/python-mode/__complex__ +++ b/snippets/python-mode/__complex__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __complex__ -# key: __complex__ +# key: complex # group: Special methods # -- def __complex__(self): diff --git a/snippets/python-mode/__contains__ b/snippets/python-mode/__contains__ index 5376c2dda..9a7632987 100644 --- a/snippets/python-mode/__contains__ +++ b/snippets/python-mode/__contains__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __contains__ -# key: __contains__ +# key: contains # group: Special methods # -- def __contains__(self, item): diff --git a/snippets/python-mode/__del__ b/snippets/python-mode/__del__ index a3a1a04b9..6a50bdce5 100644 --- a/snippets/python-mode/__del__ +++ b/snippets/python-mode/__del__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __del__ -# key: __del__ +# key: del # group: Special methods # -- def __del__(self): diff --git a/snippets/python-mode/__delattr__ b/snippets/python-mode/__delattr__ index fe41a47aa..aa91de5a0 100644 --- a/snippets/python-mode/__delattr__ +++ b/snippets/python-mode/__delattr__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __delattr__ -# key: __delattr__ +# key: delattr # group: Special methods # -- def __delattr__(self, name): diff --git a/snippets/python-mode/__delete__ b/snippets/python-mode/__delete__ index 7b216b479..fbb0deba0 100644 --- a/snippets/python-mode/__delete__ +++ b/snippets/python-mode/__delete__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __delete__ -# key: __delete__ +# key: delete # group: Special methods # -- def __delete__(self, instance): diff --git a/snippets/python-mode/__delitem__ b/snippets/python-mode/__delitem__ index fd79a02c6..223b28963 100644 --- a/snippets/python-mode/__delitem__ +++ b/snippets/python-mode/__delitem__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __delitem__ -# key: __delitem__ +# key: delitem # group: Special methods # -- def __delitem__(self, key): diff --git a/snippets/python-mode/__div__ b/snippets/python-mode/__div__ index 8da4ea92b..ab2f7e80e 100644 --- a/snippets/python-mode/__div__ +++ b/snippets/python-mode/__div__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __div__ -# key: __div__ +# key: div # group: Special methods # -- def __div__(self, other): diff --git a/snippets/python-mode/__divmod__ b/snippets/python-mode/__divmod__ index 586327479..836dd5072 100644 --- a/snippets/python-mode/__divmod__ +++ b/snippets/python-mode/__divmod__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __divmod__ -# key: __divmod__ +# key: divmod # group: Special methods # -- def __divmod__(self, other): diff --git a/snippets/python-mode/__enter__ b/snippets/python-mode/__enter__ index 598989238..c9c14bacf 100644 --- a/snippets/python-mode/__enter__ +++ b/snippets/python-mode/__enter__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __enter__ -# key: __enter__ +# key: enter # group: Special methods # -- def __enter__(self): diff --git a/snippets/python-mode/__eq__ b/snippets/python-mode/__eq__ index 0f772fff7..3e46f3a95 100644 --- a/snippets/python-mode/__eq__ +++ b/snippets/python-mode/__eq__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __eq__ -# key: __eq__ +# key: eq # group: Special methods # -- def __eq__(self, other): diff --git a/snippets/python-mode/__exit__ b/snippets/python-mode/__exit__ index e19452411..f755d7c20 100644 --- a/snippets/python-mode/__exit__ +++ b/snippets/python-mode/__exit__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __exit__ -# key: __exit__ +# key: exit # group: Special methods # -- def __exit__(self, exc_type, exc_value, traceback): diff --git a/snippets/python-mode/__float__ b/snippets/python-mode/__float__ index 6f1ab4ae4..526693a9c 100644 --- a/snippets/python-mode/__float__ +++ b/snippets/python-mode/__float__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __float__ -# key: __float__ +# key: float # group: Special methods # -- def __float__(self): diff --git a/snippets/python-mode/__floordiv__ b/snippets/python-mode/__floordiv__ index 117f174d1..4712fc35b 100644 --- a/snippets/python-mode/__floordiv__ +++ b/snippets/python-mode/__floordiv__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __floordiv__ -# key: __floordiv__ +# key: floordiv # group: Special methods # -- def __floordiv__(self, other): diff --git a/snippets/python-mode/__ge__ b/snippets/python-mode/__ge__ index a7f5c49b5..f584cf920 100644 --- a/snippets/python-mode/__ge__ +++ b/snippets/python-mode/__ge__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __ge__ -# key: __ge__ +# key: ge # group: Special methods # -- def __ge__(self, other): diff --git a/snippets/python-mode/__get__ b/snippets/python-mode/__get__ index 9d4a9fa98..388711f51 100644 --- a/snippets/python-mode/__get__ +++ b/snippets/python-mode/__get__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __get__ -# key: __get__ +# key: get # group: Special methods # -- def __get__(self, instance, owner): diff --git a/snippets/python-mode/__getattr__ b/snippets/python-mode/__getattr__ index 07e9afcdd..a829ad432 100644 --- a/snippets/python-mode/__getattr__ +++ b/snippets/python-mode/__getattr__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __getattr__ -# key: __getattr__ +# key: getattr # group: Special methods # -- def __getattr__(self, name): diff --git a/snippets/python-mode/__getattribute__ b/snippets/python-mode/__getattribute__ index e6bfedd72..a9d82a037 100644 --- a/snippets/python-mode/__getattribute__ +++ b/snippets/python-mode/__getattribute__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __getattribute__ -# key: __getattribute__ +# key: getattr # group: Special methods # -- def __getattribute__(self, name): diff --git a/snippets/python-mode/__getitem__ b/snippets/python-mode/__getitem__ index 6d73dc72f..88156612a 100644 --- a/snippets/python-mode/__getitem__ +++ b/snippets/python-mode/__getitem__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __getitem__ -# key: __getitem__ +# key: getitem # group: Special methods # -- def __getitem__(self, key): diff --git a/snippets/python-mode/__gt__ b/snippets/python-mode/__gt__ index 0fb0eb3b3..d526f1020 100644 --- a/snippets/python-mode/__gt__ +++ b/snippets/python-mode/__gt__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __gt__ -# key: __gt__ +# key: gt # group: Special methods # -- def __gt__(self, other): diff --git a/snippets/python-mode/__hash__ b/snippets/python-mode/__hash__ index a11710446..c38a088af 100644 --- a/snippets/python-mode/__hash__ +++ b/snippets/python-mode/__hash__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __hash__ -# key: __hash__ +# key: hash # group: Special methods # -- def __hash__(self): diff --git a/snippets/python-mode/__hex__ b/snippets/python-mode/__hex__ index 62df1d716..80e97ee6c 100644 --- a/snippets/python-mode/__hex__ +++ b/snippets/python-mode/__hex__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __hex__ -# key: __hex__ +# key: hex # group: Special methods # -- def __hex__(self): diff --git a/snippets/python-mode/__iadd__ b/snippets/python-mode/__iadd__ index fe1f2445e..ce0f8c7ff 100644 --- a/snippets/python-mode/__iadd__ +++ b/snippets/python-mode/__iadd__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __iadd__ -# key: __iadd__ +# key: iadd # group: Special methods # -- def __iadd__(self, other): diff --git a/snippets/python-mode/__iand__ b/snippets/python-mode/__iand__ index 6b027e91a..7d125ecc7 100644 --- a/snippets/python-mode/__iand__ +++ b/snippets/python-mode/__iand__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __iand__ -# key: __iand__ +# key: iand # group: Special methods # -- def __iand__(self, other): diff --git a/snippets/python-mode/__idiv__ b/snippets/python-mode/__idiv__ index fb32a864c..0e134f210 100644 --- a/snippets/python-mode/__idiv__ +++ b/snippets/python-mode/__idiv__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __idiv__ -# key: __idiv__ +# key: idiv # group: Special methods # -- def __idiv__(self, other): diff --git a/snippets/python-mode/__ifloordiv__ b/snippets/python-mode/__ifloordiv__ index 8d200726e..f07c8fb9e 100644 --- a/snippets/python-mode/__ifloordiv__ +++ b/snippets/python-mode/__ifloordiv__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __ifloordiv__ -# key: __ifloordiv__ +# key: ifloordiv # group: Special methods # -- def __ifloordiv__(self, other): diff --git a/snippets/python-mode/__ilshift__ b/snippets/python-mode/__ilshift__ index e29895fb8..fd77efeaf 100644 --- a/snippets/python-mode/__ilshift__ +++ b/snippets/python-mode/__ilshift__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __ilshift__ -# key: __ilshift__ +# key: ilshift # group: Special methods # -- def __ilshift__(self, other): diff --git a/snippets/python-mode/__imod__ b/snippets/python-mode/__imod__ index 4d74b1351..1580bc904 100644 --- a/snippets/python-mode/__imod__ +++ b/snippets/python-mode/__imod__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __imod__ -# key: __imod__ +# key: imod # group: Special methods # -- def __imod__(self, other): diff --git a/snippets/python-mode/__imul__ b/snippets/python-mode/__imul__ index ee8482985..4cea71130 100644 --- a/snippets/python-mode/__imul__ +++ b/snippets/python-mode/__imul__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __imul__ -# key: __imul__ +# key: imul # group: Special methods # -- def __imul__(self, other): diff --git a/snippets/python-mode/__index__ b/snippets/python-mode/__index__ index 7337f76db..393717df5 100644 --- a/snippets/python-mode/__index__ +++ b/snippets/python-mode/__index__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __index__ -# key: __index__ +# key: index # group: Special methods # -- def __index__(self): diff --git a/snippets/python-mode/__init__ b/snippets/python-mode/__init__ index e1f6cded1..b40eea456 100644 --- a/snippets/python-mode/__init__ +++ b/snippets/python-mode/__init__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __init__ with assignment -# key: __init__ +# key: init # group: Special methods # -- def __init__(self${1:, args}): diff --git a/snippets/python-mode/__instancecheck__ b/snippets/python-mode/__instancecheck__ index 4b567aa23..82998dc5d 100644 --- a/snippets/python-mode/__instancecheck__ +++ b/snippets/python-mode/__instancecheck__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __instancecheck__ -# key: __instancecheck__ +# key: instancecheck # group: Special methods # -- def __instancecheck__(self, instance): diff --git a/snippets/python-mode/__int__ b/snippets/python-mode/__int__ index fa136df36..580f19d29 100644 --- a/snippets/python-mode/__int__ +++ b/snippets/python-mode/__int__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __int__ -# key: __int__ +# key: int # group: Special methods # -- def __int__(self): diff --git a/snippets/python-mode/__invert__ b/snippets/python-mode/__invert__ index bbf1df45f..d5b504f10 100644 --- a/snippets/python-mode/__invert__ +++ b/snippets/python-mode/__invert__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __invert__ -# key: __invert__ +# key: invert # group: Special methods # -- def __invert__(self): diff --git a/snippets/python-mode/__ior__ b/snippets/python-mode/__ior__ index 045a0d54f..6b08fc389 100644 --- a/snippets/python-mode/__ior__ +++ b/snippets/python-mode/__ior__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __ior__ -# key: __ior__ +# key: ior # group: Special methods # -- def __ior__(self, other): diff --git a/snippets/python-mode/__ipow__ b/snippets/python-mode/__ipow__ index ec62f49fb..c0d9c6276 100644 --- a/snippets/python-mode/__ipow__ +++ b/snippets/python-mode/__ipow__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __ipow__ -# key: __ipow__ +# key: ipow # group: Special methods # -- def __ipow__(self, other): diff --git a/snippets/python-mode/__irshift__ b/snippets/python-mode/__irshift__ index 193f790e7..c311cafc1 100644 --- a/snippets/python-mode/__irshift__ +++ b/snippets/python-mode/__irshift__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __irshift__ -# key: __irshift__ +# key: irshift # group: Special methods # -- def __irshift__(self, other): diff --git a/snippets/python-mode/__isub__ b/snippets/python-mode/__isub__ index 70fd5747a..4eac341bc 100644 --- a/snippets/python-mode/__isub__ +++ b/snippets/python-mode/__isub__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __isub__ -# key: __isub__ +# key: isub # group: Special methods # -- def __isub__(self, other): diff --git a/snippets/python-mode/__iter__ b/snippets/python-mode/__iter__ index a7002e0ba..d534a50ce 100644 --- a/snippets/python-mode/__iter__ +++ b/snippets/python-mode/__iter__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __iter__ -# key: __iter__ +# key: iter # group: Special methods # -- def __iter__(self): diff --git a/snippets/python-mode/__itruediv__ b/snippets/python-mode/__itruediv__ index 14caec60d..68fcb7416 100644 --- a/snippets/python-mode/__itruediv__ +++ b/snippets/python-mode/__itruediv__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __itruediv__ -# key: __itruediv__ +# key: itruediv # group: Special methods # -- def __itruediv__(self, other): diff --git a/snippets/python-mode/__ixor__ b/snippets/python-mode/__ixor__ index ffba3edea..3d66739e0 100644 --- a/snippets/python-mode/__ixor__ +++ b/snippets/python-mode/__ixor__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __ixor__ -# key: __ixor__ +# key: ixor # group: Special methods # -- def __ixor__(self, other): diff --git a/snippets/python-mode/__le__ b/snippets/python-mode/__le__ index f08aebe83..bfd4deed8 100644 --- a/snippets/python-mode/__le__ +++ b/snippets/python-mode/__le__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __le__ -# key: __le__ +# key: le # group: Special methods # -- def __le__(self, other): diff --git a/snippets/python-mode/__len__ b/snippets/python-mode/__len__ index 7d15f93d6..b08bd5aca 100644 --- a/snippets/python-mode/__len__ +++ b/snippets/python-mode/__len__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __len__ -# key: __len__ +# key: len # group: Special methods # -- def __len__(self): diff --git a/snippets/python-mode/__long__ b/snippets/python-mode/__long__ index 16c3cd20b..6d99dc67e 100644 --- a/snippets/python-mode/__long__ +++ b/snippets/python-mode/__long__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __long__ -# key: __long__ +# key: long # group: Special methods # -- def __long__(self): diff --git a/snippets/python-mode/__lshift__ b/snippets/python-mode/__lshift__ index 493a21f95..9d2205efb 100644 --- a/snippets/python-mode/__lshift__ +++ b/snippets/python-mode/__lshift__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __lshift__ -# key: __lshift__ +# key: lshift # group: Special methods # -- def __lshift__(self, other): diff --git a/snippets/python-mode/__lt__ b/snippets/python-mode/__lt__ index a47a24801..aa7d24b07 100644 --- a/snippets/python-mode/__lt__ +++ b/snippets/python-mode/__lt__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __lt__ -# key: __lt__ +# key: lt # group: Special methods # -- def __lt__(self, other): diff --git a/snippets/python-mode/__mod__ b/snippets/python-mode/__mod__ index 94a5ff56c..09ae0cd54 100644 --- a/snippets/python-mode/__mod__ +++ b/snippets/python-mode/__mod__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __mod__ -# key: __mod__ +# key: mod # group: Special methods # -- def __mod__(self, other): diff --git a/snippets/python-mode/__mul__ b/snippets/python-mode/__mul__ index f4a3d7a6c..2be169de8 100644 --- a/snippets/python-mode/__mul__ +++ b/snippets/python-mode/__mul__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __mul__ -# key: __mul__ +# key: mul # group: Special methods # -- def __mul__(self, other): diff --git a/snippets/python-mode/__ne__ b/snippets/python-mode/__ne__ index 684f96754..1dccad793 100644 --- a/snippets/python-mode/__ne__ +++ b/snippets/python-mode/__ne__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __ne__ -# key: __ne__ +# key: ne # group: Special methods # -- def __ne__(self, other): diff --git a/snippets/python-mode/__neg__ b/snippets/python-mode/__neg__ index b430dcd44..e5390d26e 100644 --- a/snippets/python-mode/__neg__ +++ b/snippets/python-mode/__neg__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __neg__ -# key: __neg__ +# key: neg # group: Special methods # -- def __neg__(self): diff --git a/snippets/python-mode/__new__ b/snippets/python-mode/__new__ index aac14dcde..0d7acb035 100644 --- a/snippets/python-mode/__new__ +++ b/snippets/python-mode/__new__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __new__ -# key: __new__ +# key: new # group: Special methods # -- def __new__(cls${1:, args}): diff --git a/snippets/python-mode/__nonzero__ b/snippets/python-mode/__nonzero__ index cef110ea6..32a9f16c9 100644 --- a/snippets/python-mode/__nonzero__ +++ b/snippets/python-mode/__nonzero__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __nonzero__ -# key: __nonzero__ +# key: nonzero # group: Special methods # -- def __nonzero__(self): diff --git a/snippets/python-mode/__oct__ b/snippets/python-mode/__oct__ index 7a46b56ab..12d76ae36 100644 --- a/snippets/python-mode/__oct__ +++ b/snippets/python-mode/__oct__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __oct__ -# key: __oct__ +# key: oct # group: Special methods # -- def __oct__(self): diff --git a/snippets/python-mode/__or__ b/snippets/python-mode/__or__ index 6c14ea720..a0091ed18 100644 --- a/snippets/python-mode/__or__ +++ b/snippets/python-mode/__or__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __or__ -# key: __or__ +# key: or # group: Special methods # -- def __or__(self, other): diff --git a/snippets/python-mode/__pos__ b/snippets/python-mode/__pos__ index ac429b86d..17731d971 100644 --- a/snippets/python-mode/__pos__ +++ b/snippets/python-mode/__pos__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __pos__ -# key: __pos__ +# key: pos # group: Special methods # -- def __pos__(self): diff --git a/snippets/python-mode/__pow__ b/snippets/python-mode/__pow__ index c79910233..20839a55d 100644 --- a/snippets/python-mode/__pow__ +++ b/snippets/python-mode/__pow__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __pow__ -# key: __pow__ +# key: pow # group: Special methods # -- def __pow__(self, other, modulo=None): diff --git a/snippets/python-mode/__radd__ b/snippets/python-mode/__radd__ index 761d63d88..5072a55fd 100644 --- a/snippets/python-mode/__radd__ +++ b/snippets/python-mode/__radd__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __radd__ -# key: __radd__ +# key: radd # group: Special methods # -- def __radd__(self, other): diff --git a/snippets/python-mode/__rand__ b/snippets/python-mode/__rand__ index be85670a4..8284c5d84 100644 --- a/snippets/python-mode/__rand__ +++ b/snippets/python-mode/__rand__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rand__ -# key: __rand__ +# key: rand # group: Special methods # -- def __rand__(self, other): diff --git a/snippets/python-mode/__rdivmod__ b/snippets/python-mode/__rdivmod__ index 2c06a8737..3753511a9 100644 --- a/snippets/python-mode/__rdivmod__ +++ b/snippets/python-mode/__rdivmod__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rdivmod__ -# key: __rdivmod__ +# key: rdivmod # group: Special methods # -- def __rdivmod__(self, other): diff --git a/snippets/python-mode/__repr__ b/snippets/python-mode/__repr__ index 45ae2f9a1..2248390ee 100644 --- a/snippets/python-mode/__repr__ +++ b/snippets/python-mode/__repr__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __repr__ -# key: __repr__ +# key: repr # group: Special methods # -- def __repr__(self): diff --git a/snippets/python-mode/__reversed__ b/snippets/python-mode/__reversed__ index 8f29b7bcb..c45808ac2 100644 --- a/snippets/python-mode/__reversed__ +++ b/snippets/python-mode/__reversed__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __reversed__ -# key: __reversed__ +# key: reversed # group: Special methods # -- def __reversed__(self): diff --git a/snippets/python-mode/__rfloordiv__ b/snippets/python-mode/__rfloordiv__ index 317aeefab..3c6dafbcc 100644 --- a/snippets/python-mode/__rfloordiv__ +++ b/snippets/python-mode/__rfloordiv__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rfloordiv__ -# key: __rfloordiv__ +# key: rfloordiv # group: Special methods # -- def __rfloordiv__(self, other): diff --git a/snippets/python-mode/__rlshift__ b/snippets/python-mode/__rlshift__ index 5522f8532..c642bee9f 100644 --- a/snippets/python-mode/__rlshift__ +++ b/snippets/python-mode/__rlshift__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rlshift__ -# key: __rlshift__ +# key: rlshift # group: Special methods # -- def __rlshift__(self, other): diff --git a/snippets/python-mode/__rmod__ b/snippets/python-mode/__rmod__ index 562c07f6b..0e9a4d09b 100644 --- a/snippets/python-mode/__rmod__ +++ b/snippets/python-mode/__rmod__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rmod__ -# key: __rmod__ +# key: rmod # group: Special methods # -- def __rmod__(self, other): diff --git a/snippets/python-mode/__rmul__ b/snippets/python-mode/__rmul__ index aae0b45fc..d2caeb816 100644 --- a/snippets/python-mode/__rmul__ +++ b/snippets/python-mode/__rmul__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rmul__ -# key: __rmul__ +# key: rmul # group: Special methods # -- def __rmul__(self, other): diff --git a/snippets/python-mode/__ror__ b/snippets/python-mode/__ror__ index 07895497c..ade6d251a 100644 --- a/snippets/python-mode/__ror__ +++ b/snippets/python-mode/__ror__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __ror__ -# key: __ror__ +# key: ror # group: Special methods # -- def __ror__(self, other): diff --git a/snippets/python-mode/__rpow__ b/snippets/python-mode/__rpow__ index 7253b2e69..457bc1154 100644 --- a/snippets/python-mode/__rpow__ +++ b/snippets/python-mode/__rpow__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rpow__ -# key: __rpow__ +# key: rpow # group: Special methods # -- def __rpow__(self, other): diff --git a/snippets/python-mode/__rrshift__ b/snippets/python-mode/__rrshift__ index 5d62907d9..434f50b4c 100644 --- a/snippets/python-mode/__rrshift__ +++ b/snippets/python-mode/__rrshift__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rrshift__ -# key: __rrshift__ +# key: rrshift # group: Special methods # -- def __rrshift__(self, other): diff --git a/snippets/python-mode/__rshift__ b/snippets/python-mode/__rshift__ index 1ec6af275..b32d8a0fc 100644 --- a/snippets/python-mode/__rshift__ +++ b/snippets/python-mode/__rshift__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rshift__ -# key: __rshift__ +# key: rshift # group: Special methods # -- def __rshift__(self, other): diff --git a/snippets/python-mode/__rsub__ b/snippets/python-mode/__rsub__ index d58d7e815..643c192b8 100644 --- a/snippets/python-mode/__rsub__ +++ b/snippets/python-mode/__rsub__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rsub__ -# key: __rsub__ +# key: rsub # group: Special methods # -- def __rsub__(self, other): diff --git a/snippets/python-mode/__rtruediv__ b/snippets/python-mode/__rtruediv__ index 993d117aa..b05fa8e07 100644 --- a/snippets/python-mode/__rtruediv__ +++ b/snippets/python-mode/__rtruediv__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rtruediv__ -# key: __rtruediv__ +# key: rtruediv # group: Special methods # -- def __rtruediv__(self, other): diff --git a/snippets/python-mode/__rxor__ b/snippets/python-mode/__rxor__ index 4d1cc09fb..40e0c561e 100644 --- a/snippets/python-mode/__rxor__ +++ b/snippets/python-mode/__rxor__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rxor__ -# key: __rxor__ +# key: rxor # group: Special methods # -- def __rxor__(self, other): diff --git a/snippets/python-mode/__set__ b/snippets/python-mode/__set__ index bf87f574c..1dcb014f2 100644 --- a/snippets/python-mode/__set__ +++ b/snippets/python-mode/__set__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __set__ -# key: __set__ +# key: set # group: Special methods # -- def __set__(self, instance, value): diff --git a/snippets/python-mode/__setattr__ b/snippets/python-mode/__setattr__ index 3482e8e2f..59d9c68bb 100644 --- a/snippets/python-mode/__setattr__ +++ b/snippets/python-mode/__setattr__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __setattr__ -# key: __setattr__ +# key: setattr # group: Special methods # -- def __setattr__(self, name, value): diff --git a/snippets/python-mode/__setitem__ b/snippets/python-mode/__setitem__ index d229fa16b..9531ba603 100644 --- a/snippets/python-mode/__setitem__ +++ b/snippets/python-mode/__setitem__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __setitem__ -# key: __setitem__ +# key: setitem # group: Special methods # -- def __setitem__(self, key, value): diff --git a/snippets/python-mode/__slots__ b/snippets/python-mode/__slots__ index c35d4880b..2b57757e7 100644 --- a/snippets/python-mode/__slots__ +++ b/snippets/python-mode/__slots__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __slots__ -# key: __slots__ +# key: slots # group: Class attributes # -- __slots__ = ($1) diff --git a/snippets/python-mode/__str__ b/snippets/python-mode/__str__ index 3b3908881..5cb42a747 100644 --- a/snippets/python-mode/__str__ +++ b/snippets/python-mode/__str__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __str__ -# key: __str__ +# key: str # group: Special methods # -- def __str__(self): diff --git a/snippets/python-mode/__sub__ b/snippets/python-mode/__sub__ index a18345903..5d5e4ad66 100644 --- a/snippets/python-mode/__sub__ +++ b/snippets/python-mode/__sub__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __sub__ -# key: __sub__ +# key: sub # group: Special methods # -- def __sub__(self, other): diff --git a/snippets/python-mode/__subclasscheck__ b/snippets/python-mode/__subclasscheck__ index 3918b4cae..06f77c490 100644 --- a/snippets/python-mode/__subclasscheck__ +++ b/snippets/python-mode/__subclasscheck__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __subclasscheck__ -# key: __subclasscheck__ +# key: subclasscheck # group: Special methods # -- def __subclasscheck__(self, instance): diff --git a/snippets/python-mode/__truediv__ b/snippets/python-mode/__truediv__ index c76e0553d..ecc5c94a1 100644 --- a/snippets/python-mode/__truediv__ +++ b/snippets/python-mode/__truediv__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __truediv__ -# key: __truediv__ +# key: truediv # group: Special methods # -- def __truediv__(self, other): diff --git a/snippets/python-mode/__unicode__ b/snippets/python-mode/__unicode__ index 62b82f661..67e76b3ff 100644 --- a/snippets/python-mode/__unicode__ +++ b/snippets/python-mode/__unicode__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __unicode__ -# key: __unicode__ +# key: unicode # group: Special methods # -- def __unicode__(self): diff --git a/snippets/python-mode/__xor__ b/snippets/python-mode/__xor__ index 3c7e694bb..8ca1f6f99 100644 --- a/snippets/python-mode/__xor__ +++ b/snippets/python-mode/__xor__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __xor__ -# key: __xor__ +# key: xor # group: Special methods # -- def __xor__(self, other): From 00ebb08f3a65b0bacbede0666870780515e11d45 Mon Sep 17 00:00:00 2001 From: Nicholas D Steeves Date: Wed, 4 Apr 2018 19:12:41 -0400 Subject: [PATCH 09/16] PR #259 Change keys for __foo__ from "foo" to "_foo" Thanks to galaunay for the idea to use this to "avoid unnecessary keyspace pollution." --- snippets/python-mode/__abs__ | 2 +- snippets/python-mode/__add__ | 2 +- snippets/python-mode/__and__ | 2 +- snippets/python-mode/__bool__ | 2 +- snippets/python-mode/__call__ | 2 +- snippets/python-mode/__cmp__ | 2 +- snippets/python-mode/__coerce__ | 2 +- snippets/python-mode/__complex__ | 2 +- snippets/python-mode/__contains__ | 2 +- snippets/python-mode/__del__ | 2 +- snippets/python-mode/__delattr__ | 2 +- snippets/python-mode/__delete__ | 2 +- snippets/python-mode/__delitem__ | 2 +- snippets/python-mode/__div__ | 2 +- snippets/python-mode/__divmod__ | 2 +- snippets/python-mode/__enter__ | 2 +- snippets/python-mode/__eq__ | 2 +- snippets/python-mode/__exit__ | 2 +- snippets/python-mode/__float__ | 2 +- snippets/python-mode/__floordiv__ | 2 +- snippets/python-mode/__ge__ | 2 +- snippets/python-mode/__get__ | 2 +- snippets/python-mode/__getattr__ | 2 +- snippets/python-mode/__getattribute__ | 2 +- snippets/python-mode/__getitem__ | 2 +- snippets/python-mode/__gt__ | 2 +- snippets/python-mode/__hash__ | 2 +- snippets/python-mode/__hex__ | 2 +- snippets/python-mode/__iadd__ | 2 +- snippets/python-mode/__iand__ | 2 +- snippets/python-mode/__idiv__ | 2 +- snippets/python-mode/__ifloordiv__ | 2 +- snippets/python-mode/__ilshift__ | 2 +- snippets/python-mode/__imod__ | 2 +- snippets/python-mode/__imul__ | 2 +- snippets/python-mode/__index__ | 2 +- snippets/python-mode/__init__ | 2 +- snippets/python-mode/__instancecheck__ | 2 +- snippets/python-mode/__int__ | 2 +- snippets/python-mode/__invert__ | 2 +- snippets/python-mode/__ior__ | 2 +- snippets/python-mode/__ipow__ | 2 +- snippets/python-mode/__irshift__ | 2 +- snippets/python-mode/__isub__ | 2 +- snippets/python-mode/__iter__ | 2 +- snippets/python-mode/__itruediv__ | 2 +- snippets/python-mode/__ixor__ | 2 +- snippets/python-mode/__le__ | 2 +- snippets/python-mode/__len__ | 2 +- snippets/python-mode/__long__ | 2 +- snippets/python-mode/__lshift__ | 2 +- snippets/python-mode/__lt__ | 2 +- snippets/python-mode/__mod__ | 2 +- snippets/python-mode/__mul__ | 2 +- snippets/python-mode/__ne__ | 2 +- snippets/python-mode/__neg__ | 2 +- snippets/python-mode/__new__ | 2 +- snippets/python-mode/__nonzero__ | 2 +- snippets/python-mode/__oct__ | 2 +- snippets/python-mode/__or__ | 2 +- snippets/python-mode/__pos__ | 2 +- snippets/python-mode/__pow__ | 2 +- snippets/python-mode/__radd__ | 2 +- snippets/python-mode/__rand__ | 2 +- snippets/python-mode/__rdivmod__ | 2 +- snippets/python-mode/__repr__ | 2 +- snippets/python-mode/__reversed__ | 2 +- snippets/python-mode/__rfloordiv__ | 2 +- snippets/python-mode/__rlshift__ | 2 +- snippets/python-mode/__rmod__ | 2 +- snippets/python-mode/__rmul__ | 2 +- snippets/python-mode/__ror__ | 2 +- snippets/python-mode/__rpow__ | 2 +- snippets/python-mode/__rrshift__ | 2 +- snippets/python-mode/__rshift__ | 2 +- snippets/python-mode/__rsub__ | 2 +- snippets/python-mode/__rtruediv__ | 2 +- snippets/python-mode/__rxor__ | 2 +- snippets/python-mode/__set__ | 2 +- snippets/python-mode/__setattr__ | 2 +- snippets/python-mode/__setitem__ | 2 +- snippets/python-mode/__slots__ | 2 +- snippets/python-mode/__str__ | 2 +- snippets/python-mode/__sub__ | 2 +- snippets/python-mode/__subclasscheck__ | 2 +- snippets/python-mode/__truediv__ | 2 +- snippets/python-mode/__unicode__ | 2 +- snippets/python-mode/__xor__ | 2 +- 88 files changed, 88 insertions(+), 88 deletions(-) diff --git a/snippets/python-mode/__abs__ b/snippets/python-mode/__abs__ index a6cdedc6a..67967be41 100644 --- a/snippets/python-mode/__abs__ +++ b/snippets/python-mode/__abs__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __abs__ -# key: abs +# key: _abs # group: Special methods # -- def __abs__(self): diff --git a/snippets/python-mode/__add__ b/snippets/python-mode/__add__ index 016088634..9fef7476d 100644 --- a/snippets/python-mode/__add__ +++ b/snippets/python-mode/__add__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __add__ -# key: add +# key: _add # group: Special methods # -- def __add__(self, other): diff --git a/snippets/python-mode/__and__ b/snippets/python-mode/__and__ index 0e8141099..74c1c2a56 100644 --- a/snippets/python-mode/__and__ +++ b/snippets/python-mode/__and__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __and__ -# key: and +# key: _and # group: Special methods # -- def __and__(self, other): diff --git a/snippets/python-mode/__bool__ b/snippets/python-mode/__bool__ index 51df4528c..fd53fd36d 100644 --- a/snippets/python-mode/__bool__ +++ b/snippets/python-mode/__bool__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __bool__ -# key: bool +# key: _bool # group: Special methods # -- def __bool__(self): diff --git a/snippets/python-mode/__call__ b/snippets/python-mode/__call__ index 3631ead38..e807be58a 100644 --- a/snippets/python-mode/__call__ +++ b/snippets/python-mode/__call__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __call__ -# key: call +# key: _call # group: Special methods # -- def __call__(self, ${1:*args}): diff --git a/snippets/python-mode/__cmp__ b/snippets/python-mode/__cmp__ index 5a2de55d1..ed18d210a 100644 --- a/snippets/python-mode/__cmp__ +++ b/snippets/python-mode/__cmp__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __cmp__ -# key: cmp +# key: _cmp # group: Special methods # -- def __cmp__(self, other): diff --git a/snippets/python-mode/__coerce__ b/snippets/python-mode/__coerce__ index 5d8d51b5a..4b8f4a417 100644 --- a/snippets/python-mode/__coerce__ +++ b/snippets/python-mode/__coerce__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __coerce__ -# key: coerce +# key: _coerce # group: Special methods # -- def __coerce__(self, other): diff --git a/snippets/python-mode/__complex__ b/snippets/python-mode/__complex__ index 11a185030..69ced6489 100644 --- a/snippets/python-mode/__complex__ +++ b/snippets/python-mode/__complex__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __complex__ -# key: complex +# key: _complex # group: Special methods # -- def __complex__(self): diff --git a/snippets/python-mode/__contains__ b/snippets/python-mode/__contains__ index 9a7632987..4fca9004f 100644 --- a/snippets/python-mode/__contains__ +++ b/snippets/python-mode/__contains__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __contains__ -# key: contains +# key: _contains # group: Special methods # -- def __contains__(self, item): diff --git a/snippets/python-mode/__del__ b/snippets/python-mode/__del__ index 6a50bdce5..1f5673c34 100644 --- a/snippets/python-mode/__del__ +++ b/snippets/python-mode/__del__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __del__ -# key: del +# key: _del # group: Special methods # -- def __del__(self): diff --git a/snippets/python-mode/__delattr__ b/snippets/python-mode/__delattr__ index aa91de5a0..2c8ce9c9e 100644 --- a/snippets/python-mode/__delattr__ +++ b/snippets/python-mode/__delattr__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __delattr__ -# key: delattr +# key: _delattr # group: Special methods # -- def __delattr__(self, name): diff --git a/snippets/python-mode/__delete__ b/snippets/python-mode/__delete__ index fbb0deba0..700de5b1a 100644 --- a/snippets/python-mode/__delete__ +++ b/snippets/python-mode/__delete__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __delete__ -# key: delete +# key: _delete # group: Special methods # -- def __delete__(self, instance): diff --git a/snippets/python-mode/__delitem__ b/snippets/python-mode/__delitem__ index 223b28963..d84351993 100644 --- a/snippets/python-mode/__delitem__ +++ b/snippets/python-mode/__delitem__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __delitem__ -# key: delitem +# key: _delitem # group: Special methods # -- def __delitem__(self, key): diff --git a/snippets/python-mode/__div__ b/snippets/python-mode/__div__ index ab2f7e80e..3e774f5d8 100644 --- a/snippets/python-mode/__div__ +++ b/snippets/python-mode/__div__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __div__ -# key: div +# key: _div # group: Special methods # -- def __div__(self, other): diff --git a/snippets/python-mode/__divmod__ b/snippets/python-mode/__divmod__ index 836dd5072..b2daa769b 100644 --- a/snippets/python-mode/__divmod__ +++ b/snippets/python-mode/__divmod__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __divmod__ -# key: divmod +# key: _divmod # group: Special methods # -- def __divmod__(self, other): diff --git a/snippets/python-mode/__enter__ b/snippets/python-mode/__enter__ index c9c14bacf..9508a3276 100644 --- a/snippets/python-mode/__enter__ +++ b/snippets/python-mode/__enter__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __enter__ -# key: enter +# key: _enter # group: Special methods # -- def __enter__(self): diff --git a/snippets/python-mode/__eq__ b/snippets/python-mode/__eq__ index 3e46f3a95..7fdb0b453 100644 --- a/snippets/python-mode/__eq__ +++ b/snippets/python-mode/__eq__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __eq__ -# key: eq +# key: _eq # group: Special methods # -- def __eq__(self, other): diff --git a/snippets/python-mode/__exit__ b/snippets/python-mode/__exit__ index f755d7c20..2bac6f240 100644 --- a/snippets/python-mode/__exit__ +++ b/snippets/python-mode/__exit__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __exit__ -# key: exit +# key: _exit # group: Special methods # -- def __exit__(self, exc_type, exc_value, traceback): diff --git a/snippets/python-mode/__float__ b/snippets/python-mode/__float__ index 526693a9c..d1f81ab18 100644 --- a/snippets/python-mode/__float__ +++ b/snippets/python-mode/__float__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __float__ -# key: float +# key: _float # group: Special methods # -- def __float__(self): diff --git a/snippets/python-mode/__floordiv__ b/snippets/python-mode/__floordiv__ index 4712fc35b..c335b587e 100644 --- a/snippets/python-mode/__floordiv__ +++ b/snippets/python-mode/__floordiv__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __floordiv__ -# key: floordiv +# key: _floordiv # group: Special methods # -- def __floordiv__(self, other): diff --git a/snippets/python-mode/__ge__ b/snippets/python-mode/__ge__ index f584cf920..97f687303 100644 --- a/snippets/python-mode/__ge__ +++ b/snippets/python-mode/__ge__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __ge__ -# key: ge +# key: _ge # group: Special methods # -- def __ge__(self, other): diff --git a/snippets/python-mode/__get__ b/snippets/python-mode/__get__ index 388711f51..ace91298a 100644 --- a/snippets/python-mode/__get__ +++ b/snippets/python-mode/__get__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __get__ -# key: get +# key: _get # group: Special methods # -- def __get__(self, instance, owner): diff --git a/snippets/python-mode/__getattr__ b/snippets/python-mode/__getattr__ index a829ad432..110d0d017 100644 --- a/snippets/python-mode/__getattr__ +++ b/snippets/python-mode/__getattr__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __getattr__ -# key: getattr +# key: _getattr # group: Special methods # -- def __getattr__(self, name): diff --git a/snippets/python-mode/__getattribute__ b/snippets/python-mode/__getattribute__ index a9d82a037..fac95c3ef 100644 --- a/snippets/python-mode/__getattribute__ +++ b/snippets/python-mode/__getattribute__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __getattribute__ -# key: getattr +# key: _getattr # group: Special methods # -- def __getattribute__(self, name): diff --git a/snippets/python-mode/__getitem__ b/snippets/python-mode/__getitem__ index 88156612a..cd0877551 100644 --- a/snippets/python-mode/__getitem__ +++ b/snippets/python-mode/__getitem__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __getitem__ -# key: getitem +# key: _getitem # group: Special methods # -- def __getitem__(self, key): diff --git a/snippets/python-mode/__gt__ b/snippets/python-mode/__gt__ index d526f1020..527717eb7 100644 --- a/snippets/python-mode/__gt__ +++ b/snippets/python-mode/__gt__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __gt__ -# key: gt +# key: _gt # group: Special methods # -- def __gt__(self, other): diff --git a/snippets/python-mode/__hash__ b/snippets/python-mode/__hash__ index c38a088af..e059f5a82 100644 --- a/snippets/python-mode/__hash__ +++ b/snippets/python-mode/__hash__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __hash__ -# key: hash +# key: _hash # group: Special methods # -- def __hash__(self): diff --git a/snippets/python-mode/__hex__ b/snippets/python-mode/__hex__ index 80e97ee6c..afc3c9321 100644 --- a/snippets/python-mode/__hex__ +++ b/snippets/python-mode/__hex__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __hex__ -# key: hex +# key: _hex # group: Special methods # -- def __hex__(self): diff --git a/snippets/python-mode/__iadd__ b/snippets/python-mode/__iadd__ index ce0f8c7ff..77108c267 100644 --- a/snippets/python-mode/__iadd__ +++ b/snippets/python-mode/__iadd__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __iadd__ -# key: iadd +# key: _iadd # group: Special methods # -- def __iadd__(self, other): diff --git a/snippets/python-mode/__iand__ b/snippets/python-mode/__iand__ index 7d125ecc7..8b61e1cff 100644 --- a/snippets/python-mode/__iand__ +++ b/snippets/python-mode/__iand__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __iand__ -# key: iand +# key: _iand # group: Special methods # -- def __iand__(self, other): diff --git a/snippets/python-mode/__idiv__ b/snippets/python-mode/__idiv__ index 0e134f210..c9e5609f4 100644 --- a/snippets/python-mode/__idiv__ +++ b/snippets/python-mode/__idiv__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __idiv__ -# key: idiv +# key: _idiv # group: Special methods # -- def __idiv__(self, other): diff --git a/snippets/python-mode/__ifloordiv__ b/snippets/python-mode/__ifloordiv__ index f07c8fb9e..fd40fd280 100644 --- a/snippets/python-mode/__ifloordiv__ +++ b/snippets/python-mode/__ifloordiv__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __ifloordiv__ -# key: ifloordiv +# key: _ifloordiv # group: Special methods # -- def __ifloordiv__(self, other): diff --git a/snippets/python-mode/__ilshift__ b/snippets/python-mode/__ilshift__ index fd77efeaf..8e4576337 100644 --- a/snippets/python-mode/__ilshift__ +++ b/snippets/python-mode/__ilshift__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __ilshift__ -# key: ilshift +# key: _ilshift # group: Special methods # -- def __ilshift__(self, other): diff --git a/snippets/python-mode/__imod__ b/snippets/python-mode/__imod__ index 1580bc904..5d3f70e6b 100644 --- a/snippets/python-mode/__imod__ +++ b/snippets/python-mode/__imod__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __imod__ -# key: imod +# key: _imod # group: Special methods # -- def __imod__(self, other): diff --git a/snippets/python-mode/__imul__ b/snippets/python-mode/__imul__ index 4cea71130..ecf66b6e6 100644 --- a/snippets/python-mode/__imul__ +++ b/snippets/python-mode/__imul__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __imul__ -# key: imul +# key: _imul # group: Special methods # -- def __imul__(self, other): diff --git a/snippets/python-mode/__index__ b/snippets/python-mode/__index__ index 393717df5..e03b1c7f0 100644 --- a/snippets/python-mode/__index__ +++ b/snippets/python-mode/__index__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __index__ -# key: index +# key: _index # group: Special methods # -- def __index__(self): diff --git a/snippets/python-mode/__init__ b/snippets/python-mode/__init__ index b40eea456..28e758131 100644 --- a/snippets/python-mode/__init__ +++ b/snippets/python-mode/__init__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __init__ with assignment -# key: init +# key: _init # group: Special methods # -- def __init__(self${1:, args}): diff --git a/snippets/python-mode/__instancecheck__ b/snippets/python-mode/__instancecheck__ index 82998dc5d..8a5e42975 100644 --- a/snippets/python-mode/__instancecheck__ +++ b/snippets/python-mode/__instancecheck__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __instancecheck__ -# key: instancecheck +# key: _instancecheck # group: Special methods # -- def __instancecheck__(self, instance): diff --git a/snippets/python-mode/__int__ b/snippets/python-mode/__int__ index 580f19d29..01224927e 100644 --- a/snippets/python-mode/__int__ +++ b/snippets/python-mode/__int__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __int__ -# key: int +# key: _int # group: Special methods # -- def __int__(self): diff --git a/snippets/python-mode/__invert__ b/snippets/python-mode/__invert__ index d5b504f10..e5e0a2de8 100644 --- a/snippets/python-mode/__invert__ +++ b/snippets/python-mode/__invert__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __invert__ -# key: invert +# key: _invert # group: Special methods # -- def __invert__(self): diff --git a/snippets/python-mode/__ior__ b/snippets/python-mode/__ior__ index 6b08fc389..07ce0dcac 100644 --- a/snippets/python-mode/__ior__ +++ b/snippets/python-mode/__ior__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __ior__ -# key: ior +# key: _ior # group: Special methods # -- def __ior__(self, other): diff --git a/snippets/python-mode/__ipow__ b/snippets/python-mode/__ipow__ index c0d9c6276..8f0ea5d59 100644 --- a/snippets/python-mode/__ipow__ +++ b/snippets/python-mode/__ipow__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __ipow__ -# key: ipow +# key: _ipow # group: Special methods # -- def __ipow__(self, other): diff --git a/snippets/python-mode/__irshift__ b/snippets/python-mode/__irshift__ index c311cafc1..b250a5a96 100644 --- a/snippets/python-mode/__irshift__ +++ b/snippets/python-mode/__irshift__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __irshift__ -# key: irshift +# key: _irshift # group: Special methods # -- def __irshift__(self, other): diff --git a/snippets/python-mode/__isub__ b/snippets/python-mode/__isub__ index 4eac341bc..abd0888c5 100644 --- a/snippets/python-mode/__isub__ +++ b/snippets/python-mode/__isub__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __isub__ -# key: isub +# key: _isub # group: Special methods # -- def __isub__(self, other): diff --git a/snippets/python-mode/__iter__ b/snippets/python-mode/__iter__ index d534a50ce..29414ad27 100644 --- a/snippets/python-mode/__iter__ +++ b/snippets/python-mode/__iter__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __iter__ -# key: iter +# key: _iter # group: Special methods # -- def __iter__(self): diff --git a/snippets/python-mode/__itruediv__ b/snippets/python-mode/__itruediv__ index 68fcb7416..3332f321e 100644 --- a/snippets/python-mode/__itruediv__ +++ b/snippets/python-mode/__itruediv__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __itruediv__ -# key: itruediv +# key: _itruediv # group: Special methods # -- def __itruediv__(self, other): diff --git a/snippets/python-mode/__ixor__ b/snippets/python-mode/__ixor__ index 3d66739e0..dae309506 100644 --- a/snippets/python-mode/__ixor__ +++ b/snippets/python-mode/__ixor__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __ixor__ -# key: ixor +# key: _ixor # group: Special methods # -- def __ixor__(self, other): diff --git a/snippets/python-mode/__le__ b/snippets/python-mode/__le__ index bfd4deed8..774188b25 100644 --- a/snippets/python-mode/__le__ +++ b/snippets/python-mode/__le__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __le__ -# key: le +# key: _le # group: Special methods # -- def __le__(self, other): diff --git a/snippets/python-mode/__len__ b/snippets/python-mode/__len__ index b08bd5aca..e5544cb24 100644 --- a/snippets/python-mode/__len__ +++ b/snippets/python-mode/__len__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __len__ -# key: len +# key: _len # group: Special methods # -- def __len__(self): diff --git a/snippets/python-mode/__long__ b/snippets/python-mode/__long__ index 6d99dc67e..99cae5cbb 100644 --- a/snippets/python-mode/__long__ +++ b/snippets/python-mode/__long__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __long__ -# key: long +# key: _long # group: Special methods # -- def __long__(self): diff --git a/snippets/python-mode/__lshift__ b/snippets/python-mode/__lshift__ index 9d2205efb..bfb4cc2d9 100644 --- a/snippets/python-mode/__lshift__ +++ b/snippets/python-mode/__lshift__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __lshift__ -# key: lshift +# key: _lshift # group: Special methods # -- def __lshift__(self, other): diff --git a/snippets/python-mode/__lt__ b/snippets/python-mode/__lt__ index aa7d24b07..8c34b05d5 100644 --- a/snippets/python-mode/__lt__ +++ b/snippets/python-mode/__lt__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __lt__ -# key: lt +# key: _lt # group: Special methods # -- def __lt__(self, other): diff --git a/snippets/python-mode/__mod__ b/snippets/python-mode/__mod__ index 09ae0cd54..22a987e48 100644 --- a/snippets/python-mode/__mod__ +++ b/snippets/python-mode/__mod__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __mod__ -# key: mod +# key: _mod # group: Special methods # -- def __mod__(self, other): diff --git a/snippets/python-mode/__mul__ b/snippets/python-mode/__mul__ index 2be169de8..d8fae7c45 100644 --- a/snippets/python-mode/__mul__ +++ b/snippets/python-mode/__mul__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __mul__ -# key: mul +# key: _mul # group: Special methods # -- def __mul__(self, other): diff --git a/snippets/python-mode/__ne__ b/snippets/python-mode/__ne__ index 1dccad793..0ed5f8f62 100644 --- a/snippets/python-mode/__ne__ +++ b/snippets/python-mode/__ne__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __ne__ -# key: ne +# key: _ne # group: Special methods # -- def __ne__(self, other): diff --git a/snippets/python-mode/__neg__ b/snippets/python-mode/__neg__ index e5390d26e..7e56f6b51 100644 --- a/snippets/python-mode/__neg__ +++ b/snippets/python-mode/__neg__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __neg__ -# key: neg +# key: _neg # group: Special methods # -- def __neg__(self): diff --git a/snippets/python-mode/__new__ b/snippets/python-mode/__new__ index 0d7acb035..b0f15beac 100644 --- a/snippets/python-mode/__new__ +++ b/snippets/python-mode/__new__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __new__ -# key: new +# key: _new # group: Special methods # -- def __new__(cls${1:, args}): diff --git a/snippets/python-mode/__nonzero__ b/snippets/python-mode/__nonzero__ index 32a9f16c9..98521d336 100644 --- a/snippets/python-mode/__nonzero__ +++ b/snippets/python-mode/__nonzero__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __nonzero__ -# key: nonzero +# key: _nonzero # group: Special methods # -- def __nonzero__(self): diff --git a/snippets/python-mode/__oct__ b/snippets/python-mode/__oct__ index 12d76ae36..0c43e46d0 100644 --- a/snippets/python-mode/__oct__ +++ b/snippets/python-mode/__oct__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __oct__ -# key: oct +# key: _oct # group: Special methods # -- def __oct__(self): diff --git a/snippets/python-mode/__or__ b/snippets/python-mode/__or__ index a0091ed18..f6589061a 100644 --- a/snippets/python-mode/__or__ +++ b/snippets/python-mode/__or__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __or__ -# key: or +# key: _or # group: Special methods # -- def __or__(self, other): diff --git a/snippets/python-mode/__pos__ b/snippets/python-mode/__pos__ index 17731d971..de08b0975 100644 --- a/snippets/python-mode/__pos__ +++ b/snippets/python-mode/__pos__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __pos__ -# key: pos +# key: _pos # group: Special methods # -- def __pos__(self): diff --git a/snippets/python-mode/__pow__ b/snippets/python-mode/__pow__ index 20839a55d..4006c0a0e 100644 --- a/snippets/python-mode/__pow__ +++ b/snippets/python-mode/__pow__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __pow__ -# key: pow +# key: _pow # group: Special methods # -- def __pow__(self, other, modulo=None): diff --git a/snippets/python-mode/__radd__ b/snippets/python-mode/__radd__ index 5072a55fd..5fa27d13e 100644 --- a/snippets/python-mode/__radd__ +++ b/snippets/python-mode/__radd__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __radd__ -# key: radd +# key: _radd # group: Special methods # -- def __radd__(self, other): diff --git a/snippets/python-mode/__rand__ b/snippets/python-mode/__rand__ index 8284c5d84..e3156ef71 100644 --- a/snippets/python-mode/__rand__ +++ b/snippets/python-mode/__rand__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rand__ -# key: rand +# key: _rand # group: Special methods # -- def __rand__(self, other): diff --git a/snippets/python-mode/__rdivmod__ b/snippets/python-mode/__rdivmod__ index 3753511a9..4fc1ccb39 100644 --- a/snippets/python-mode/__rdivmod__ +++ b/snippets/python-mode/__rdivmod__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rdivmod__ -# key: rdivmod +# key: _rdivmod # group: Special methods # -- def __rdivmod__(self, other): diff --git a/snippets/python-mode/__repr__ b/snippets/python-mode/__repr__ index 2248390ee..85cb80f04 100644 --- a/snippets/python-mode/__repr__ +++ b/snippets/python-mode/__repr__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __repr__ -# key: repr +# key: _repr # group: Special methods # -- def __repr__(self): diff --git a/snippets/python-mode/__reversed__ b/snippets/python-mode/__reversed__ index c45808ac2..ff2a5a12a 100644 --- a/snippets/python-mode/__reversed__ +++ b/snippets/python-mode/__reversed__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __reversed__ -# key: reversed +# key: _reversed # group: Special methods # -- def __reversed__(self): diff --git a/snippets/python-mode/__rfloordiv__ b/snippets/python-mode/__rfloordiv__ index 3c6dafbcc..cb5375df6 100644 --- a/snippets/python-mode/__rfloordiv__ +++ b/snippets/python-mode/__rfloordiv__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rfloordiv__ -# key: rfloordiv +# key: _rfloordiv # group: Special methods # -- def __rfloordiv__(self, other): diff --git a/snippets/python-mode/__rlshift__ b/snippets/python-mode/__rlshift__ index c642bee9f..64a676196 100644 --- a/snippets/python-mode/__rlshift__ +++ b/snippets/python-mode/__rlshift__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rlshift__ -# key: rlshift +# key: _rlshift # group: Special methods # -- def __rlshift__(self, other): diff --git a/snippets/python-mode/__rmod__ b/snippets/python-mode/__rmod__ index 0e9a4d09b..1b4e035ef 100644 --- a/snippets/python-mode/__rmod__ +++ b/snippets/python-mode/__rmod__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rmod__ -# key: rmod +# key: _rmod # group: Special methods # -- def __rmod__(self, other): diff --git a/snippets/python-mode/__rmul__ b/snippets/python-mode/__rmul__ index d2caeb816..459d5323e 100644 --- a/snippets/python-mode/__rmul__ +++ b/snippets/python-mode/__rmul__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rmul__ -# key: rmul +# key: _rmul # group: Special methods # -- def __rmul__(self, other): diff --git a/snippets/python-mode/__ror__ b/snippets/python-mode/__ror__ index ade6d251a..91293cbd6 100644 --- a/snippets/python-mode/__ror__ +++ b/snippets/python-mode/__ror__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __ror__ -# key: ror +# key: _ror # group: Special methods # -- def __ror__(self, other): diff --git a/snippets/python-mode/__rpow__ b/snippets/python-mode/__rpow__ index 457bc1154..2521f161c 100644 --- a/snippets/python-mode/__rpow__ +++ b/snippets/python-mode/__rpow__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rpow__ -# key: rpow +# key: _rpow # group: Special methods # -- def __rpow__(self, other): diff --git a/snippets/python-mode/__rrshift__ b/snippets/python-mode/__rrshift__ index 434f50b4c..78f4ae7e9 100644 --- a/snippets/python-mode/__rrshift__ +++ b/snippets/python-mode/__rrshift__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rrshift__ -# key: rrshift +# key: _rrshift # group: Special methods # -- def __rrshift__(self, other): diff --git a/snippets/python-mode/__rshift__ b/snippets/python-mode/__rshift__ index b32d8a0fc..061c396b8 100644 --- a/snippets/python-mode/__rshift__ +++ b/snippets/python-mode/__rshift__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rshift__ -# key: rshift +# key: _rshift # group: Special methods # -- def __rshift__(self, other): diff --git a/snippets/python-mode/__rsub__ b/snippets/python-mode/__rsub__ index 643c192b8..1d7b24325 100644 --- a/snippets/python-mode/__rsub__ +++ b/snippets/python-mode/__rsub__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rsub__ -# key: rsub +# key: _rsub # group: Special methods # -- def __rsub__(self, other): diff --git a/snippets/python-mode/__rtruediv__ b/snippets/python-mode/__rtruediv__ index b05fa8e07..a0cba2cd4 100644 --- a/snippets/python-mode/__rtruediv__ +++ b/snippets/python-mode/__rtruediv__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rtruediv__ -# key: rtruediv +# key: _rtruediv # group: Special methods # -- def __rtruediv__(self, other): diff --git a/snippets/python-mode/__rxor__ b/snippets/python-mode/__rxor__ index 40e0c561e..b5473ad25 100644 --- a/snippets/python-mode/__rxor__ +++ b/snippets/python-mode/__rxor__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __rxor__ -# key: rxor +# key: _rxor # group: Special methods # -- def __rxor__(self, other): diff --git a/snippets/python-mode/__set__ b/snippets/python-mode/__set__ index 1dcb014f2..19572c15f 100644 --- a/snippets/python-mode/__set__ +++ b/snippets/python-mode/__set__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __set__ -# key: set +# key: _set # group: Special methods # -- def __set__(self, instance, value): diff --git a/snippets/python-mode/__setattr__ b/snippets/python-mode/__setattr__ index 59d9c68bb..5311cf0ee 100644 --- a/snippets/python-mode/__setattr__ +++ b/snippets/python-mode/__setattr__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __setattr__ -# key: setattr +# key: _setattr # group: Special methods # -- def __setattr__(self, name, value): diff --git a/snippets/python-mode/__setitem__ b/snippets/python-mode/__setitem__ index 9531ba603..0287f0e5f 100644 --- a/snippets/python-mode/__setitem__ +++ b/snippets/python-mode/__setitem__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __setitem__ -# key: setitem +# key: _setitem # group: Special methods # -- def __setitem__(self, key, value): diff --git a/snippets/python-mode/__slots__ b/snippets/python-mode/__slots__ index 2b57757e7..e7ea51e50 100644 --- a/snippets/python-mode/__slots__ +++ b/snippets/python-mode/__slots__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __slots__ -# key: slots +# key: _slots # group: Class attributes # -- __slots__ = ($1) diff --git a/snippets/python-mode/__str__ b/snippets/python-mode/__str__ index 5cb42a747..f623df7ee 100644 --- a/snippets/python-mode/__str__ +++ b/snippets/python-mode/__str__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __str__ -# key: str +# key: _str # group: Special methods # -- def __str__(self): diff --git a/snippets/python-mode/__sub__ b/snippets/python-mode/__sub__ index 5d5e4ad66..d21d13c9c 100644 --- a/snippets/python-mode/__sub__ +++ b/snippets/python-mode/__sub__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __sub__ -# key: sub +# key: _sub # group: Special methods # -- def __sub__(self, other): diff --git a/snippets/python-mode/__subclasscheck__ b/snippets/python-mode/__subclasscheck__ index 06f77c490..0f3a61d42 100644 --- a/snippets/python-mode/__subclasscheck__ +++ b/snippets/python-mode/__subclasscheck__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __subclasscheck__ -# key: subclasscheck +# key: _subclasscheck # group: Special methods # -- def __subclasscheck__(self, instance): diff --git a/snippets/python-mode/__truediv__ b/snippets/python-mode/__truediv__ index ecc5c94a1..00181b14d 100644 --- a/snippets/python-mode/__truediv__ +++ b/snippets/python-mode/__truediv__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __truediv__ -# key: truediv +# key: _truediv # group: Special methods # -- def __truediv__(self, other): diff --git a/snippets/python-mode/__unicode__ b/snippets/python-mode/__unicode__ index 67e76b3ff..b61e501ad 100644 --- a/snippets/python-mode/__unicode__ +++ b/snippets/python-mode/__unicode__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __unicode__ -# key: unicode +# key: _unicode # group: Special methods # -- def __unicode__(self): diff --git a/snippets/python-mode/__xor__ b/snippets/python-mode/__xor__ index 8ca1f6f99..d84b99ff9 100644 --- a/snippets/python-mode/__xor__ +++ b/snippets/python-mode/__xor__ @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: __xor__ -# key: xor +# key: _xor # group: Special methods # -- def __xor__(self, other): From a302f027c9e6cd78d5dd1cb3cc4438b33d6a4bfc Mon Sep 17 00:00:00 2001 From: Nicholas D Steeves Date: Tue, 17 Apr 2018 21:04:02 -0400 Subject: [PATCH 10/16] Change elpy prefixes to yas-snips Thanks to Andrea Crotti for the review and suggestion. --- snippets/python-mode/.yas-setup.el | 18 +++++++++--------- snippets/python-mode/__init__ | 2 +- snippets/python-mode/__new__ | 2 +- snippets/python-mode/class | 2 +- snippets/python-mode/super | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/snippets/python-mode/.yas-setup.el b/snippets/python-mode/.yas-setup.el index af53c4850..d0d402ee4 100644 --- a/snippets/python-mode/.yas-setup.el +++ b/snippets/python-mode/.yas-setup.el @@ -33,7 +33,7 @@ "\nReturns\n-------" formatted-ret) "\n")))) -(defun elpy-snippet-current-method-and-args () +(defun yas-snips-snippet-current-method-and-args () "Return information on the current definition." (let ((current-defun (python-info-current-defun)) (current-arglist @@ -45,7 +45,7 @@ (forward-char -1) (forward-sexp) (- (point) 1)))) - (elpy-snippet-split-args + (yas-snips-snippet-split-args (buffer-substring-no-properties start end)))))) class method args) (when (not current-arglist) @@ -59,7 +59,7 @@ (setq args (mapcar #'car current-arglist)) (list class method args))) -(defun elpy-snippet-init-assignments (arg-string) +(defun yas-snips-snippet-init-assignments (arg-string) "Return the typical __init__ assignments for arguments." (let ((indentation (make-string (save-excursion (goto-char start-point) @@ -72,26 +72,26 @@ (car arg) (car arg) indentation))) - (elpy-snippet-split-args arg-string) + (yas-snips-snippet-split-args arg-string) ""))) -(defun elpy-snippet-super-form () +(defun yas-snips-snippet-super-form () "Return (Class, first-arg).method if Py2. Else return ().method for Py3." - (let* ((defun-info (elpy-snippet-current-method-and-args)) + (let* ((defun-info (yas-snips-snippet-current-method-and-args)) (class (nth 0 defun-info)) (method (nth 1 defun-info)) (args (nth 2 defun-info)) (first-arg (nth 0 args)) (py-version-command " -c 'import sys ; print(sys.version_info.major)'") ;; Get the python version. Either 2 or 3 - (py-version-num (substring (shell-command-to-string (concat elpy-rpc-python-command py-version-command))0 1))) + (py-version-num (substring (shell-command-to-string (concat yas-snips-rpc-python-command py-version-command))0 1))) (if (string-match py-version-num "2") (format "(%s, %s).%s" class first-arg method) (format "().%s" method)))) -(defun elpy-snippet-super-arguments () +(defun yas-snips-snippet-super-arguments () "Return the argument list for the current method." (mapconcat (lambda (x) x) - (cdr (nth 2 (elpy-snippet-current-method-and-args))) + (cdr (nth 2 (yas-snips-snippet-current-method-and-args))) ", ")) diff --git a/snippets/python-mode/__init__ b/snippets/python-mode/__init__ index 28e758131..492a6c87a 100644 --- a/snippets/python-mode/__init__ +++ b/snippets/python-mode/__init__ @@ -7,4 +7,4 @@ def __init__(self${1:, args}): """$2 """ - ${1:$(elpy-snippet-init-assignments yas-text)} + ${1:$(yas-snips-snippet-init-assignments yas-text)} diff --git a/snippets/python-mode/__new__ b/snippets/python-mode/__new__ index b0f15beac..0963c2530 100644 --- a/snippets/python-mode/__new__ +++ b/snippets/python-mode/__new__ @@ -7,4 +7,4 @@ def __new__(cls${1:, args}): """$2 """ - ${1:$(elpy-snippet-init-assignments yas-text)} + ${1:$(yas-snips-snippet-init-assignments yas-text)} diff --git a/snippets/python-mode/class b/snippets/python-mode/class index b5c180de7..68094c1eb 100644 --- a/snippets/python-mode/class +++ b/snippets/python-mode/class @@ -9,5 +9,5 @@ class ${1:ClassName}(${2:object}): """ def __init__(self${4:, args}): super($1, self).__init__($5) - ${4:$(elpy-snippet-init-assignments yas-text)} + ${4:$(yas-snips-snippet-init-assignments yas-text)} $0 diff --git a/snippets/python-mode/super b/snippets/python-mode/super index 17c66646a..8d0607e34 100644 --- a/snippets/python-mode/super +++ b/snippets/python-mode/super @@ -3,5 +3,5 @@ # key: super # group: Definitions # -- -super`(elpy-snippet-super-form)`(${1:`(elpy-snippet-super-arguments)`}) +super`(yas-snips-snippet-super-form)`(${1:`(yas-snips-snippet-super-arguments)`}) $0 From 7fc7274ef887a530516dc9c6c1cc892e279363ea Mon Sep 17 00:00:00 2001 From: Nicholas D Steeves Date: Tue, 17 Apr 2018 21:19:54 -0400 Subject: [PATCH 11/16] Add newline at end of file for all files that were missing one. --- snippets/python-mode/all | 2 +- snippets/python-mode/arg_positional | 2 +- snippets/python-mode/assert | 2 +- snippets/python-mode/assertEqual | 2 +- snippets/python-mode/assertFalse | 2 +- snippets/python-mode/assertIn | 2 +- snippets/python-mode/assertNotEqual | 2 +- snippets/python-mode/assertNotIn | 2 +- snippets/python-mode/assertRaises | 2 +- snippets/python-mode/assertTrue | 2 +- snippets/python-mode/bang | 2 +- snippets/python-mode/celery_pdb | 2 +- snippets/python-mode/classmethod | 2 +- snippets/python-mode/dec | 2 +- snippets/python-mode/deftest | 2 +- snippets/python-mode/django_test_class | 2 +- snippets/python-mode/doc | 2 +- snippets/python-mode/doctest | 2 +- snippets/python-mode/eq | 2 +- snippets/python-mode/for | 2 +- snippets/python-mode/function_docstring | 2 +- snippets/python-mode/function_docstring_numpy | 2 +- snippets/python-mode/ifmain | 2 +- snippets/python-mode/import | 2 +- snippets/python-mode/init | 2 +- snippets/python-mode/init_docstring | 2 +- snippets/python-mode/interact | 2 +- snippets/python-mode/ipdbdebug | 2 +- snippets/python-mode/iter | 2 +- snippets/python-mode/lambda | 2 +- snippets/python-mode/list | 2 +- snippets/python-mode/logger_name | 2 +- snippets/python-mode/main | 2 +- snippets/python-mode/method | 2 +- snippets/python-mode/method_docstring | 2 +- snippets/python-mode/not_impl | 2 +- snippets/python-mode/np | 2 +- snippets/python-mode/parse_args | 2 +- snippets/python-mode/parser | 2 +- snippets/python-mode/pass | 2 +- snippets/python-mode/print | 2 +- snippets/python-mode/reg | 2 +- snippets/python-mode/repr | 2 +- snippets/python-mode/return | 2 +- snippets/python-mode/self | 2 +- snippets/python-mode/self_without_dot | 2 +- snippets/python-mode/selfassign | 2 +- snippets/python-mode/setdef | 2 +- snippets/python-mode/size | 2 +- snippets/python-mode/str | 2 +- snippets/python-mode/test_file | 2 +- snippets/python-mode/trace | 2 +- snippets/python-mode/try | 2 +- snippets/python-mode/tryelse | 2 +- snippets/python-mode/unicode | 2 +- snippets/python-mode/while | 2 +- snippets/python-mode/with | 2 +- snippets/python-mode/with_statement | 2 +- 58 files changed, 58 insertions(+), 58 deletions(-) diff --git a/snippets/python-mode/all b/snippets/python-mode/all index b92c4dc39..12fd788c5 100644 --- a/snippets/python-mode/all +++ b/snippets/python-mode/all @@ -4,4 +4,4 @@ # -- __all__ = [ $0 -] \ No newline at end of file +] diff --git a/snippets/python-mode/arg_positional b/snippets/python-mode/arg_positional index b54fc4653..8138cfa98 100644 --- a/snippets/python-mode/arg_positional +++ b/snippets/python-mode/arg_positional @@ -3,4 +3,4 @@ # key: arg # group: argparser # -- -parser.add_argument('${1:varname}', $0) \ No newline at end of file +parser.add_argument('${1:varname}', $0) diff --git a/snippets/python-mode/assert b/snippets/python-mode/assert index ec82efe19..dfd707f68 100644 --- a/snippets/python-mode/assert +++ b/snippets/python-mode/assert @@ -3,4 +3,4 @@ # key: ass # group: testing # -- -assert $0 \ No newline at end of file +assert $0 diff --git a/snippets/python-mode/assertEqual b/snippets/python-mode/assertEqual index 29282b905..64be83b55 100644 --- a/snippets/python-mode/assertEqual +++ b/snippets/python-mode/assertEqual @@ -3,4 +3,4 @@ # key: ae # group: testing # -- -self.assertEqual($1, $2) \ No newline at end of file +self.assertEqual($1, $2) diff --git a/snippets/python-mode/assertFalse b/snippets/python-mode/assertFalse index 41a9dcfbb..3c21b3668 100644 --- a/snippets/python-mode/assertFalse +++ b/snippets/python-mode/assertFalse @@ -3,4 +3,4 @@ # key: af # group: testing # -- -self.assertFalse($0) \ No newline at end of file +self.assertFalse($0) diff --git a/snippets/python-mode/assertIn b/snippets/python-mode/assertIn index 74e1ee7c0..5ef11cad7 100644 --- a/snippets/python-mode/assertIn +++ b/snippets/python-mode/assertIn @@ -3,4 +3,4 @@ # key: ai # group: testing # -- -self.assertIn(${1:member}, ${2:container}) \ No newline at end of file +self.assertIn(${1:member}, ${2:container}) diff --git a/snippets/python-mode/assertNotEqual b/snippets/python-mode/assertNotEqual index 68374076c..4cb759b2f 100644 --- a/snippets/python-mode/assertNotEqual +++ b/snippets/python-mode/assertNotEqual @@ -3,4 +3,4 @@ # key: ane # group: testing # -- -self.assertNotEqual($1, $2) \ No newline at end of file +self.assertNotEqual($1, $2) diff --git a/snippets/python-mode/assertNotIn b/snippets/python-mode/assertNotIn index 4780a7ec5..d59f88604 100644 --- a/snippets/python-mode/assertNotIn +++ b/snippets/python-mode/assertNotIn @@ -3,4 +3,4 @@ # key: an # group: testing # -- -self.assertNotIn(${1:member}, ${2:container}) \ No newline at end of file +self.assertNotIn(${1:member}, ${2:container}) diff --git a/snippets/python-mode/assertRaises b/snippets/python-mode/assertRaises index db125da73..489be0f50 100644 --- a/snippets/python-mode/assertRaises +++ b/snippets/python-mode/assertRaises @@ -3,4 +3,4 @@ # key: ar # group: testing # -- -self.assertRaises(${1:Exception}, ${2:fun}) \ No newline at end of file +self.assertRaises(${1:Exception}, ${2:fun}) diff --git a/snippets/python-mode/assertTrue b/snippets/python-mode/assertTrue index 1cc59ac6a..0d4b25edc 100644 --- a/snippets/python-mode/assertTrue +++ b/snippets/python-mode/assertTrue @@ -3,4 +3,4 @@ # key: at # group: testing # -- -self.assertTrue($0) \ No newline at end of file +self.assertTrue($0) diff --git a/snippets/python-mode/bang b/snippets/python-mode/bang index d70a4a2c4..5e873f8f7 100644 --- a/snippets/python-mode/bang +++ b/snippets/python-mode/bang @@ -3,4 +3,4 @@ # key: #! # contributor : @avelino # -- -#!/usr/bin/env python \ No newline at end of file +#!/usr/bin/env python diff --git a/snippets/python-mode/celery_pdb b/snippets/python-mode/celery_pdb index 6095b2d37..34c67858f 100644 --- a/snippets/python-mode/celery_pdb +++ b/snippets/python-mode/celery_pdb @@ -3,4 +3,4 @@ # key: cdb # group: debug # -- -from celery.contrib import rdb; rdb.set_trace() \ No newline at end of file +from celery.contrib import rdb; rdb.set_trace() diff --git a/snippets/python-mode/classmethod b/snippets/python-mode/classmethod index 8e0e106e2..e3121f474 100644 --- a/snippets/python-mode/classmethod +++ b/snippets/python-mode/classmethod @@ -5,4 +5,4 @@ # -- @classmethod def ${1:meth}(cls, $2): - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/dec b/snippets/python-mode/dec index b22c9e920..b1bee7d02 100644 --- a/snippets/python-mode/dec +++ b/snippets/python-mode/dec @@ -11,4 +11,4 @@ def ${1:decorator}(func): $4 return ret - return _$1 \ No newline at end of file + return _$1 diff --git a/snippets/python-mode/deftest b/snippets/python-mode/deftest index 394553aec..ed3ec6c6e 100644 --- a/snippets/python-mode/deftest +++ b/snippets/python-mode/deftest @@ -4,4 +4,4 @@ # group: testing # -- def test_${1:long_name}(self): - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/django_test_class b/snippets/python-mode/django_test_class index 386e3058c..30d2714b3 100644 --- a/snippets/python-mode/django_test_class +++ b/snippets/python-mode/django_test_class @@ -4,4 +4,4 @@ # group: testing # -- class ${1:Model}Test(TestCase): - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/doc b/snippets/python-mode/doc index 2929e7897..a7d924afe 100644 --- a/snippets/python-mode/doc +++ b/snippets/python-mode/doc @@ -3,4 +3,4 @@ # key: d # -- """$0 -""" \ No newline at end of file +""" diff --git a/snippets/python-mode/doctest b/snippets/python-mode/doctest index a5e4bb540..3f2adc624 100644 --- a/snippets/python-mode/doctest +++ b/snippets/python-mode/doctest @@ -5,4 +5,4 @@ # -- >>> ${1:function calls} ${2:desired output} -$0 \ No newline at end of file +$0 diff --git a/snippets/python-mode/eq b/snippets/python-mode/eq index e19c32851..e2a7b6f57 100644 --- a/snippets/python-mode/eq +++ b/snippets/python-mode/eq @@ -4,4 +4,4 @@ # group: dunder methods # -- def __eq__(self, other): - return self.$1 == other.$1 \ No newline at end of file + return self.$1 == other.$1 diff --git a/snippets/python-mode/for b/snippets/python-mode/for index 0033c8756..3b88fd48c 100644 --- a/snippets/python-mode/for +++ b/snippets/python-mode/for @@ -3,4 +3,4 @@ # group : control structure # -- for ${var} in ${collection}: - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/function_docstring b/snippets/python-mode/function_docstring index f372d265e..3e66c26fa 100644 --- a/snippets/python-mode/function_docstring +++ b/snippets/python-mode/function_docstring @@ -8,4 +8,4 @@ def ${1:name}($2): \"\"\"$3 ${2:$(python-args-to-docstring)} \"\"\" - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/function_docstring_numpy b/snippets/python-mode/function_docstring_numpy index 3a7243e6b..0fbc108a0 100644 --- a/snippets/python-mode/function_docstring_numpy +++ b/snippets/python-mode/function_docstring_numpy @@ -8,4 +8,4 @@ def ${1:name}($2): \"\"\"$3 ${2:$(python-args-to-docstring-numpy)} \"\"\" - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/ifmain b/snippets/python-mode/ifmain index 9575798d6..cb74405c9 100644 --- a/snippets/python-mode/ifmain +++ b/snippets/python-mode/ifmain @@ -3,4 +3,4 @@ # key: ifm # -- if __name__ == '__main__': - ${1:main()} \ No newline at end of file + ${1:main()} diff --git a/snippets/python-mode/import b/snippets/python-mode/import index f34bc390d..1ff1ca8d0 100644 --- a/snippets/python-mode/import +++ b/snippets/python-mode/import @@ -4,4 +4,4 @@ # group : general # -- import ${1:lib}${2: as ${3:alias}} -$0 \ No newline at end of file +$0 diff --git a/snippets/python-mode/init b/snippets/python-mode/init index aece55c49..a50756f15 100644 --- a/snippets/python-mode/init +++ b/snippets/python-mode/init @@ -5,4 +5,4 @@ # -- def __init__(self${1:, args}): ${2:"${3:docstring}" - }$0 \ No newline at end of file + }$0 diff --git a/snippets/python-mode/init_docstring b/snippets/python-mode/init_docstring index 51af8db4b..7256541a4 100644 --- a/snippets/python-mode/init_docstring +++ b/snippets/python-mode/init_docstring @@ -7,4 +7,4 @@ def __init__(self$1): \"\"\"$2 ${1:$(python-args-to-docstring)} \"\"\" - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/interact b/snippets/python-mode/interact index 4b412c813..07bed2728 100644 --- a/snippets/python-mode/interact +++ b/snippets/python-mode/interact @@ -2,4 +2,4 @@ # name: interact # key: int # -- -import code; code.interact(local=locals()) \ No newline at end of file +import code; code.interact(local=locals()) diff --git a/snippets/python-mode/ipdbdebug b/snippets/python-mode/ipdbdebug index f45ad75ed..da650e46f 100644 --- a/snippets/python-mode/ipdbdebug +++ b/snippets/python-mode/ipdbdebug @@ -3,4 +3,4 @@ # key: itr # group: debug # -- -import ipdb; ipdb.set_trace() \ No newline at end of file +import ipdb; ipdb.set_trace() diff --git a/snippets/python-mode/iter b/snippets/python-mode/iter index a4fed1383..cf9a6ceee 100644 --- a/snippets/python-mode/iter +++ b/snippets/python-mode/iter @@ -4,4 +4,4 @@ # group: dunder methods # -- def __iter__(self): - return ${1:iter($2)} \ No newline at end of file + return ${1:iter($2)} diff --git a/snippets/python-mode/lambda b/snippets/python-mode/lambda index 08b268bd3..c3e9879c7 100644 --- a/snippets/python-mode/lambda +++ b/snippets/python-mode/lambda @@ -2,4 +2,4 @@ # name: lambda # key: lam # -- -lambda ${1:x}: $0 \ No newline at end of file +lambda ${1:x}: $0 diff --git a/snippets/python-mode/list b/snippets/python-mode/list index 63cef24a8..8da114ef9 100644 --- a/snippets/python-mode/list +++ b/snippets/python-mode/list @@ -4,4 +4,4 @@ # group : definitions # -- [${1:el} for $1 in ${2:list}] -$0 \ No newline at end of file +$0 diff --git a/snippets/python-mode/logger_name b/snippets/python-mode/logger_name index 9759dd92f..1cdcc9eda 100644 --- a/snippets/python-mode/logger_name +++ b/snippets/python-mode/logger_name @@ -2,4 +2,4 @@ # name: logger_name # key: ln # -- -logger = logging.getLogger(${1:__name__}) \ No newline at end of file +logger = logging.getLogger(${1:__name__}) diff --git a/snippets/python-mode/main b/snippets/python-mode/main index 9f3c721ed..df753e3b1 100644 --- a/snippets/python-mode/main +++ b/snippets/python-mode/main @@ -3,4 +3,4 @@ # key: main # -- def main(): - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/method b/snippets/python-mode/method index 985ef0c9d..dd969d1de 100644 --- a/snippets/python-mode/method +++ b/snippets/python-mode/method @@ -4,4 +4,4 @@ # group: object oriented # -- def ${1:method}(self${2:, $3}): - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/method_docstring b/snippets/python-mode/method_docstring index 8f5e78d01..affc63d4e 100644 --- a/snippets/python-mode/method_docstring +++ b/snippets/python-mode/method_docstring @@ -7,4 +7,4 @@ def ${1:name}(self$2): \"\"\"$3 ${2:$(python-args-to-docstring)} \"\"\" - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/not_impl b/snippets/python-mode/not_impl index 515e35344..2d35c4581 100644 --- a/snippets/python-mode/not_impl +++ b/snippets/python-mode/not_impl @@ -2,4 +2,4 @@ # name: not_impl # key: not_impl # -- -raise NotImplementedError \ No newline at end of file +raise NotImplementedError diff --git a/snippets/python-mode/np b/snippets/python-mode/np index 9f6327c8e..aa6bff8fc 100644 --- a/snippets/python-mode/np +++ b/snippets/python-mode/np @@ -4,4 +4,4 @@ # group : general # -- import numpy as np -$0 \ No newline at end of file +$0 diff --git a/snippets/python-mode/parse_args b/snippets/python-mode/parse_args index aa6107010..89c8b971f 100644 --- a/snippets/python-mode/parse_args +++ b/snippets/python-mode/parse_args @@ -6,4 +6,4 @@ def parse_arguments(): parser = argparse.ArgumentParser(description='$1') $0 - return parser.parse_args() \ No newline at end of file + return parser.parse_args() diff --git a/snippets/python-mode/parser b/snippets/python-mode/parser index 29a04eaa4..c52e1791b 100644 --- a/snippets/python-mode/parser +++ b/snippets/python-mode/parser @@ -4,4 +4,4 @@ # group: argparser # -- parser = argparse.ArgumentParser(description='$1') -$0 \ No newline at end of file +$0 diff --git a/snippets/python-mode/pass b/snippets/python-mode/pass index 4734f7fb3..9e8818953 100644 --- a/snippets/python-mode/pass +++ b/snippets/python-mode/pass @@ -2,4 +2,4 @@ # name: pass # key: ps # -- -pass \ No newline at end of file +pass diff --git a/snippets/python-mode/print b/snippets/python-mode/print index cc1c797e4..2f908990f 100644 --- a/snippets/python-mode/print +++ b/snippets/python-mode/print @@ -2,4 +2,4 @@ # name: print # key: p # -- -print($0) \ No newline at end of file +print($0) diff --git a/snippets/python-mode/reg b/snippets/python-mode/reg index c4ebeacfa..567cb3aca 100644 --- a/snippets/python-mode/reg +++ b/snippets/python-mode/reg @@ -4,4 +4,4 @@ # group : general # -- ${1:regexp} = re.compile(r"${2:expr}") -$0 \ No newline at end of file +$0 diff --git a/snippets/python-mode/repr b/snippets/python-mode/repr index a1f67833f..e6072b148 100644 --- a/snippets/python-mode/repr +++ b/snippets/python-mode/repr @@ -4,4 +4,4 @@ # group: dunder methods # -- def __repr__(self): - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/return b/snippets/python-mode/return index 641a308a3..43263d2d6 100644 --- a/snippets/python-mode/return +++ b/snippets/python-mode/return @@ -2,4 +2,4 @@ # name: return # key: r # -- -return $0 \ No newline at end of file +return $0 diff --git a/snippets/python-mode/self b/snippets/python-mode/self index 4461022be..9928c5a72 100644 --- a/snippets/python-mode/self +++ b/snippets/python-mode/self @@ -3,4 +3,4 @@ # key: . # group: object oriented # -- -self.$0 \ No newline at end of file +self.$0 diff --git a/snippets/python-mode/self_without_dot b/snippets/python-mode/self_without_dot index a1a05261e..81178b8fe 100644 --- a/snippets/python-mode/self_without_dot +++ b/snippets/python-mode/self_without_dot @@ -3,4 +3,4 @@ # key: s # group: object oriented # -- -self \ No newline at end of file +self diff --git a/snippets/python-mode/selfassign b/snippets/python-mode/selfassign index 95d7b2bb8..bc37fabf9 100644 --- a/snippets/python-mode/selfassign +++ b/snippets/python-mode/selfassign @@ -3,4 +3,4 @@ # key: sn # group: object oriented # -- -self.$1 = $1 \ No newline at end of file +self.$1 = $1 diff --git a/snippets/python-mode/setdef b/snippets/python-mode/setdef index 2398eb106..71b56d974 100644 --- a/snippets/python-mode/setdef +++ b/snippets/python-mode/setdef @@ -2,4 +2,4 @@ # name: setdef # key: setdef # -- -${1:var}.setdefault(${2:key}, []).append(${3:value}) \ No newline at end of file +${1:var}.setdefault(${2:key}, []).append(${3:value}) diff --git a/snippets/python-mode/size b/snippets/python-mode/size index 47a0f384c..a6ed6ab5e 100644 --- a/snippets/python-mode/size +++ b/snippets/python-mode/size @@ -2,4 +2,4 @@ # name: size # key: size # -- -sys.getsizeof($0) \ No newline at end of file +sys.getsizeof($0) diff --git a/snippets/python-mode/str b/snippets/python-mode/str index b0572e330..493442998 100644 --- a/snippets/python-mode/str +++ b/snippets/python-mode/str @@ -4,4 +4,4 @@ # group: dunder methods # -- def __str__(self): - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/test_file b/snippets/python-mode/test_file index e4b531549..3fad172fc 100644 --- a/snippets/python-mode/test_file +++ b/snippets/python-mode/test_file @@ -9,4 +9,4 @@ ${1:from ${2:test_file} import *} $0 if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main() diff --git a/snippets/python-mode/trace b/snippets/python-mode/trace index e475d62e5..3dad54b3e 100644 --- a/snippets/python-mode/trace +++ b/snippets/python-mode/trace @@ -3,4 +3,4 @@ # key: tr # group: debug # -- -import pdb; pdb.set_trace() \ No newline at end of file +import pdb; pdb.set_trace() diff --git a/snippets/python-mode/try b/snippets/python-mode/try index 8836de61f..4aae33128 100644 --- a/snippets/python-mode/try +++ b/snippets/python-mode/try @@ -5,4 +5,4 @@ try: $1 except ${2:Exception}: - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/tryelse b/snippets/python-mode/tryelse index f2e44e4af..0f85fe230 100644 --- a/snippets/python-mode/tryelse +++ b/snippets/python-mode/tryelse @@ -7,4 +7,4 @@ try: except $2: $3 else: - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/unicode b/snippets/python-mode/unicode index 52d6b8d2c..9d2bc6665 100644 --- a/snippets/python-mode/unicode +++ b/snippets/python-mode/unicode @@ -4,4 +4,4 @@ # group: dunder methods # -- def __unicode__(self): - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/while b/snippets/python-mode/while index 7b3539c69..a482fac06 100644 --- a/snippets/python-mode/while +++ b/snippets/python-mode/while @@ -4,4 +4,4 @@ # group: control structure # -- while ${1:True}: - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/with b/snippets/python-mode/with index 7fcbd3820..e17133cc6 100644 --- a/snippets/python-mode/with +++ b/snippets/python-mode/with @@ -4,4 +4,4 @@ # group : control structure # -- with ${1:expr}${2: as ${3:alias}}: - $0 \ No newline at end of file + $0 diff --git a/snippets/python-mode/with_statement b/snippets/python-mode/with_statement index 1be36928d..2ff928141 100644 --- a/snippets/python-mode/with_statement +++ b/snippets/python-mode/with_statement @@ -3,4 +3,4 @@ # key: fw # group: future # -- -from __future__ import with_statement \ No newline at end of file +from __future__ import with_statement From 9361eb560f3a85355a29fff0a35b65bbe37a5629 Mon Sep 17 00:00:00 2001 From: galaunay Date: Mon, 23 Apr 2018 22:36:23 +0100 Subject: [PATCH 12/16] Make python snippets able to handle arguments with type annotations. --- snippets/python-mode/.yas-setup.el | 32 ++++++++++++++++++------------ 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/snippets/python-mode/.yas-setup.el b/snippets/python-mode/.yas-setup.el index d0d402ee4..5ddac72ba 100644 --- a/snippets/python-mode/.yas-setup.el +++ b/snippets/python-mode/.yas-setup.el @@ -1,13 +1,23 @@ (defvar yas-text) +(defvar python-split-arg-arg-regex +"\\([[:alnum:]*]+\\)\\(:[[:blank:]]*[[:alpha:]]*\\)?\\([[:blank:]]*=[[:blank:]]*[[:alnum:]]*\\)?" +"Regular expression matching an argument of a python function. +First group should give the argument name.") + +(defvar python-split-arg-separator +"[[:blank:]]*,[[:blank:]]*" +"Regular expression matching the separator in a list of argument.") + (defun python-split-args (arg-string) - "Split a python argument string into ((name, default)..) tuples" + "Split a python argument string ARG-STRING into a tuple of argument names." (mapcar (lambda (x) - (split-string x "[[:blank:]]*=[[:blank:]]*" t)) - (split-string arg-string "[[:blank:]]*,[[:blank:]]*" t))) + (when (string-match python-split-arg-arg-regex x) + (match-string-no-properties 1 x))) + (split-string arg-string python-split-arg-separator t))) (defun python-args-to-docstring () - "return docstring format for the python arguments in yas-text" + "Return docstring format for the python arguments in yas-text." (let* ((indent (concat "\n" (make-string (current-column) 32))) (args (python-split-args yas-text)) (max-len (if args (apply 'max (mapcar (lambda (x) (length (nth 0 x))) args)) 0)) @@ -49,29 +59,25 @@ (buffer-substring-no-properties start end)))))) class method args) (when (not current-arglist) - (setq current-arglist '(("self")))) + (setq current-arglist '("self"))) (if (and current-defun (string-match "^\\(.*\\)\\.\\(.*\\)$" current-defun)) (setq class (match-string 1 current-defun) method (match-string 2 current-defun)) (setq class "Class" method "method")) - (setq args (mapcar #'car current-arglist)) - (list class method args))) + (list class method current-arglist))) (defun yas-snips-snippet-init-assignments (arg-string) - "Return the typical __init__ assignments for arguments." + "Return the typical __init__ assignments for arguments in ARG-STRING." (let ((indentation (make-string (save-excursion (goto-char start-point) (current-indentation)) ?\s))) (mapconcat (lambda (arg) - (if (string-match "^\\*" (car arg)) + (if (string-match "^\\*" arg) "" - (format "self.%s = %s\n%s" - (car arg) - (car arg) - indentation))) + (format "self.%s = %s\n%s" arg arg indentation))) (yas-snips-snippet-split-args arg-string) ""))) From 60ac7eccd954da1273e096ff05fddea77be42986 Mon Sep 17 00:00:00 2001 From: galaunay Date: Mon, 23 Apr 2018 22:50:52 +0100 Subject: [PATCH 13/16] Fix bug due to passage from elpy to yasnippet --- snippets/python-mode/.yas-setup.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snippets/python-mode/.yas-setup.el b/snippets/python-mode/.yas-setup.el index 5ddac72ba..f45399470 100644 --- a/snippets/python-mode/.yas-setup.el +++ b/snippets/python-mode/.yas-setup.el @@ -1,3 +1,4 @@ +(require 'yasnippet) (defvar yas-text) (defvar python-split-arg-arg-regex @@ -91,7 +92,7 @@ Else return ().method for Py3." (first-arg (nth 0 args)) (py-version-command " -c 'import sys ; print(sys.version_info.major)'") ;; Get the python version. Either 2 or 3 - (py-version-num (substring (shell-command-to-string (concat yas-snips-rpc-python-command py-version-command))0 1))) + (py-version-num (substring (shell-command-to-string (concat "python" py-version-command)) 0 1))) (if (string-match py-version-num "2") (format "(%s, %s).%s" class first-arg method) (format "().%s" method)))) From 11d78a97c4c7abf3a6f9805d8657add368686807 Mon Sep 17 00:00:00 2001 From: galaunay Date: Tue, 8 May 2018 12:58:29 +0100 Subject: [PATCH 14/16] Fix bug when specifying arguments on several lines --- snippets/python-mode/.yas-setup.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/python-mode/.yas-setup.el b/snippets/python-mode/.yas-setup.el index f45399470..1df1b7cd6 100644 --- a/snippets/python-mode/.yas-setup.el +++ b/snippets/python-mode/.yas-setup.el @@ -7,7 +7,7 @@ First group should give the argument name.") (defvar python-split-arg-separator -"[[:blank:]]*,[[:blank:]]*" +"[[:space:]]*,[[:space:]]*" "Regular expression matching the separator in a list of argument.") (defun python-split-args (arg-string) From 6828266921283d22c6ffc917ca07d01b6f59e584 Mon Sep 17 00:00:00 2001 From: Nicholas D Steeves Date: Sun, 17 Jun 2018 17:45:38 -0400 Subject: [PATCH 15/16] Allow detection of Python 3 on PEP 394-compliant systems. Please note that python-interpreter must be set to "python3" for this to function correctly. As a side-effect it also allows the use of Python 2 on systems that install version 3 to /usr/bin/python and version 2 to /usr/bin/python2. --- snippets/python-mode/.yas-setup.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/snippets/python-mode/.yas-setup.el b/snippets/python-mode/.yas-setup.el index 1df1b7cd6..5a5b55c9f 100644 --- a/snippets/python-mode/.yas-setup.el +++ b/snippets/python-mode/.yas-setup.el @@ -91,8 +91,17 @@ Else return ().method for Py3." (args (nth 2 defun-info)) (first-arg (nth 0 args)) (py-version-command " -c 'import sys ; print(sys.version_info.major)'") - ;; Get the python version. Either 2 or 3 - (py-version-num (substring (shell-command-to-string (concat "python" py-version-command)) 0 1))) + ;; Check for distribution-defined or user-defined python-interpreter. + ;; If python-interpreter is not set, then py-version-command + ;; will always return "2" for "python" on PEP 394-compliant + ;; systems. + (if (fboundp 'python-interpreter) + (py-version-num (substring (shell-command-to-string (concat python-interpreter py-version-command)) 0 1)) + ;; Otherwise get the version from "python" in $PATH + ;; This preserves support for virtualenvs that may have + ;; either version 2 or 3 installed as "python"--and also + ;; for distributions that install Python 3 to $PATH/python + (py-version-num (substring (shell-command-to-string (concat "python" py-version-command)) 0 1)))) (if (string-match py-version-num "2") (format "(%s, %s).%s" class first-arg method) (format "().%s" method)))) From 051f034a73792ea0fe750d93ef5db0d1ea6c9ef4 Mon Sep 17 00:00:00 2001 From: Nicholas D Steeves Date: Thu, 18 Oct 2018 20:05:54 -0400 Subject: [PATCH 16/16] Use start-point from yas--apply-transform in snippet-init-assignment yas-snips-snippet-init-assignments should use values provided by yas--apply-transform instead of grabbing them itself. Thanks to npostavs for finding this issue. See review discussion at PR #278 for more info (search for "yas--apply-transform"). --- snippets/python-mode/.yas-setup.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/snippets/python-mode/.yas-setup.el b/snippets/python-mode/.yas-setup.el index 5a5b55c9f..4192b53cd 100644 --- a/snippets/python-mode/.yas-setup.el +++ b/snippets/python-mode/.yas-setup.el @@ -71,9 +71,7 @@ First group should give the argument name.") (defun yas-snips-snippet-init-assignments (arg-string) "Return the typical __init__ assignments for arguments in ARG-STRING." - (let ((indentation (make-string (save-excursion - (goto-char start-point) - (current-indentation)) + (let ((indentation (make-string (current-indentation) ?\s))) (mapconcat (lambda (arg) (if (string-match "^\\*" arg)