Install yasnippet and vala-snippets packages
This commit is contained in:
@@ -0,0 +1 @@
|
||||
prog-mode
|
@@ -0,0 +1,24 @@
|
||||
(defvar yas-text)
|
||||
|
||||
(defun python-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 python-args-to-docstring ()
|
||||
"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))
|
||||
(formatted-args (mapconcat
|
||||
(lambda (x)
|
||||
(concat (nth 0 x) (make-string (- max-len (length (nth 0 x))) ? ) " -- "
|
||||
(if (nth 1 x) (concat "\(default " (nth 1 x) "\)"))))
|
||||
args
|
||||
indent)))
|
||||
(unless (string= formatted-args "")
|
||||
(mapconcat 'identity (list "Keyword Arguments:" formatted-args) indent))))
|
||||
|
||||
(add-hook 'python-mode-hook
|
||||
'(lambda () (set (make-local-variable 'yas-indent-line) 'fixed)))
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: __contains__
|
||||
# key: cont
|
||||
# group: dunder methods
|
||||
# --
|
||||
def __contains__(self, el):
|
||||
$0
|
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: __enter__
|
||||
# key: ent
|
||||
# group: dunder methods
|
||||
# --
|
||||
def __enter__(self):
|
||||
$0
|
||||
|
||||
return self
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: __exit__
|
||||
# key: ex
|
||||
# group: dunder methods
|
||||
# --
|
||||
def __exit__(self, type, value, traceback):
|
||||
$0
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: __getitem__
|
||||
# key: getit
|
||||
# group: dunder methods
|
||||
# --
|
||||
def __getitem__(self, ${1:key}):
|
||||
$0
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: __len__
|
||||
# key: len
|
||||
# group: dunder methods
|
||||
# --
|
||||
def __len__(self):
|
||||
$0
|
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: __new__
|
||||
# key: new
|
||||
# group: dunder methods
|
||||
# --
|
||||
def __new__(mcs, name, bases, dict):
|
||||
$0
|
||||
return type.__new__(mcs, name, bases, dict)
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: __setitem__
|
||||
# key: setit
|
||||
# group: dunder methods
|
||||
# --
|
||||
def __setitem__(self, ${1:key}, ${2:val}):
|
||||
$0
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/all
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/all
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: all
|
||||
# key: all
|
||||
# --
|
||||
__all__ = [
|
||||
$0
|
||||
]
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/arg
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/arg
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: arg
|
||||
# key: arg
|
||||
# group: argparser
|
||||
# --
|
||||
parser.add_argument('-$1', '--$2',
|
||||
$0)
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: arg_positional
|
||||
# key: arg
|
||||
# group: argparser
|
||||
# --
|
||||
parser.add_argument('${1:varname}', $0)
|
6
elpa/yasnippet-20160924.2001/snippets/python-mode/assert
Normal file
6
elpa/yasnippet-20160924.2001/snippets/python-mode/assert
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: assert
|
||||
# key: ass
|
||||
# group: testing
|
||||
# --
|
||||
assert $0
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: assertEqual
|
||||
# key: ae
|
||||
# group: testing
|
||||
# --
|
||||
self.assertEqual($1, $2)
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: assertFalse
|
||||
# key: af
|
||||
# group: testing
|
||||
# --
|
||||
self.assertFalse($0)
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: assertIn
|
||||
# key: ai
|
||||
# group: testing
|
||||
# --
|
||||
self.assertIn(${1:member}, ${2:container})
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: assertNotEqual
|
||||
# key: ane
|
||||
# group: testing
|
||||
# --
|
||||
self.assertNotEqual($1, $2)
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: assetNotIn
|
||||
# key: an
|
||||
# group: testing
|
||||
# --
|
||||
self.assertNotIn(${1:member}, ${2:container})
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: assertRaises
|
||||
# key: ar
|
||||
# group: testing
|
||||
# --
|
||||
self.assertRaises(${1:Exception}, ${2:fun})
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: assertRaises
|
||||
# key: ar
|
||||
# --
|
||||
with self.assertRaises(${1:Exception}):
|
||||
$0
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: assertTrue
|
||||
# key: at
|
||||
# group: testing
|
||||
# --
|
||||
self.assertTrue($0)
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: celery pdb
|
||||
# key: cdb
|
||||
# group: debug
|
||||
# --
|
||||
from celery.contrib import rdb; rdb.set_trace()
|
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: classmethod
|
||||
# key: cm
|
||||
# group: object oriented
|
||||
# --
|
||||
@classmethod
|
||||
def ${1:meth}(cls, $0):
|
||||
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/cls
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/cls
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: class
|
||||
# key: cls
|
||||
# group: object oriented
|
||||
# --
|
||||
class ${1:class}:
|
||||
$0
|
14
elpa/yasnippet-20160924.2001/snippets/python-mode/dec
Normal file
14
elpa/yasnippet-20160924.2001/snippets/python-mode/dec
Normal file
@@ -0,0 +1,14 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: dec
|
||||
# key: dec
|
||||
# group : definitions
|
||||
# --
|
||||
def ${1:decorator}(func):
|
||||
$2
|
||||
def _$1(*args, **kwargs):
|
||||
$3
|
||||
ret = func(*args, **kwargs)
|
||||
$4
|
||||
return ret
|
||||
|
||||
return _$1
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: deftest
|
||||
# key: dt
|
||||
# group: testing
|
||||
# --
|
||||
def test_${1:long_name}(self):
|
||||
$0
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet; require-final-newline: nil -*-
|
||||
# name: django_test_class
|
||||
# key: tcs
|
||||
# group: testing
|
||||
# --
|
||||
class ${1:Model}Test(TestCase):
|
||||
$0
|
6
elpa/yasnippet-20160924.2001/snippets/python-mode/doc
Normal file
6
elpa/yasnippet-20160924.2001/snippets/python-mode/doc
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: doc
|
||||
# key: d
|
||||
# --
|
||||
"""$0
|
||||
"""
|
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: doctest
|
||||
# key: doc
|
||||
# group: testing
|
||||
# --
|
||||
>>> ${1:function calls}
|
||||
${2:desired output}
|
||||
$0
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/eq
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/eq
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: __eq__
|
||||
# key: eq
|
||||
# group: dunder methods
|
||||
# --
|
||||
def __eq__(self, other):
|
||||
return self.$1 == other.$1
|
6
elpa/yasnippet-20160924.2001/snippets/python-mode/for
Normal file
6
elpa/yasnippet-20160924.2001/snippets/python-mode/for
Normal file
@@ -0,0 +1,6 @@
|
||||
# name: for ... in ... : ...
|
||||
# key: for
|
||||
# group : control structure
|
||||
# --
|
||||
for ${var} in ${collection}:
|
||||
$0
|
6
elpa/yasnippet-20160924.2001/snippets/python-mode/from
Normal file
6
elpa/yasnippet-20160924.2001/snippets/python-mode/from
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: from
|
||||
# key: from
|
||||
# group : general
|
||||
# --
|
||||
from ${1:lib} import ${2:funs}
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: function
|
||||
# key: f
|
||||
# group: definitions
|
||||
# --
|
||||
def ${1:fun}(${2:args}):
|
||||
$0
|
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: function_docstring
|
||||
# key: fd
|
||||
# group: definitions
|
||||
# --
|
||||
def ${1:name}($2):
|
||||
\"\"\"$3
|
||||
${2:$(python-args-to-docstring)}
|
||||
\"\"\"
|
||||
$0
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/if
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/if
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: if
|
||||
# key: if
|
||||
# group : control structure
|
||||
# --
|
||||
if ${1:cond}:
|
||||
$0
|
9
elpa/yasnippet-20160924.2001/snippets/python-mode/ife
Normal file
9
elpa/yasnippet-20160924.2001/snippets/python-mode/ife
Normal file
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: ife
|
||||
# key: ife
|
||||
# group : control structure
|
||||
# --
|
||||
if $1:
|
||||
$2
|
||||
else:
|
||||
$0
|
6
elpa/yasnippet-20160924.2001/snippets/python-mode/ifmain
Normal file
6
elpa/yasnippet-20160924.2001/snippets/python-mode/ifmain
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: ifmain
|
||||
# key: ifm
|
||||
# --
|
||||
if __name__ == '__main__':
|
||||
${1:main()}
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/import
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/import
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: import
|
||||
# key: imp
|
||||
# group : general
|
||||
# --
|
||||
import ${1:lib}${2: as ${3:alias}}
|
||||
$0
|
8
elpa/yasnippet-20160924.2001/snippets/python-mode/init
Normal file
8
elpa/yasnippet-20160924.2001/snippets/python-mode/init
Normal file
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: init
|
||||
# key: init
|
||||
# group : definitions
|
||||
# --
|
||||
def __init__(self${1:, args}):
|
||||
${2:"${3:docstring}"
|
||||
}$0
|
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: init_docstring
|
||||
# key: id
|
||||
# group : definitions
|
||||
# --
|
||||
def __init__(self$1):
|
||||
\"\"\"$2
|
||||
${1:$(python-args-to-docstring)}
|
||||
\"\"\"
|
||||
$0
|
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: interact
|
||||
# key: int
|
||||
# --
|
||||
import code; code.interact(local=locals())
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet; require-final-newline: nil -*-
|
||||
# name: ipdb trace
|
||||
# key: itr
|
||||
# group: debug
|
||||
# --
|
||||
import ipdb; ipdb.set_trace()
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/iter
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/iter
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: __iter__
|
||||
# key: iter
|
||||
# group: dunder methods
|
||||
# --
|
||||
def __iter__(self):
|
||||
return ${1:iter($2)}
|
5
elpa/yasnippet-20160924.2001/snippets/python-mode/lambda
Normal file
5
elpa/yasnippet-20160924.2001/snippets/python-mode/lambda
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: lambda
|
||||
# key: lam
|
||||
# --
|
||||
lambda ${1:x}: $0
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/list
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/list
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: list
|
||||
# key: li
|
||||
# group : definitions
|
||||
# --
|
||||
[${1:el} for $1 in ${2:list}]
|
||||
$0
|
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: logger_name
|
||||
# key: ln
|
||||
# --
|
||||
logger = logging.getLogger(${1:__name__})
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: logging
|
||||
# key: log
|
||||
# --
|
||||
logger = logging.getLogger("${1:name}")
|
||||
logger.setLevel(logging.${2:level})
|
6
elpa/yasnippet-20160924.2001/snippets/python-mode/main
Normal file
6
elpa/yasnippet-20160924.2001/snippets/python-mode/main
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: main
|
||||
# key: main
|
||||
# --
|
||||
def main():
|
||||
$0
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: metaclass
|
||||
# key: mt
|
||||
# group: object oriented
|
||||
# --
|
||||
__metaclass__ = type
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/method
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/method
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: method
|
||||
# key: m
|
||||
# group: object oriented
|
||||
# --
|
||||
def ${1:method}(self${2:, $3}):
|
||||
$0
|
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: method_docstring
|
||||
# key: md
|
||||
# group: object oriented
|
||||
# --
|
||||
def ${1:name}(self$2):
|
||||
\"\"\"$3
|
||||
${2:$(python-args-to-docstring)}
|
||||
\"\"\"
|
||||
$0
|
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: not_impl
|
||||
# key: not_impl
|
||||
# --
|
||||
raise NotImplementedError
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/np
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/np
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: np
|
||||
# key: np
|
||||
# group : general
|
||||
# --
|
||||
import numpy as np
|
||||
$0
|
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: parse_args
|
||||
# key: pargs
|
||||
# group: argparser
|
||||
# --
|
||||
def parse_arguments():
|
||||
parser = argparse.ArgumentParser(description='$1')
|
||||
$0
|
||||
return parser.parse_args()
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/parser
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/parser
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: parser
|
||||
# key: pars
|
||||
# group: argparser
|
||||
# --
|
||||
parser = argparse.ArgumentParser(description='$1')
|
||||
$0
|
5
elpa/yasnippet-20160924.2001/snippets/python-mode/pass
Normal file
5
elpa/yasnippet-20160924.2001/snippets/python-mode/pass
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: pass
|
||||
# key: ps
|
||||
# --
|
||||
pass
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/pl
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/pl
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: Import pyplot
|
||||
# key: plt
|
||||
# group : general
|
||||
# --
|
||||
import matplotlib.pyplot as plt
|
||||
$0
|
5
elpa/yasnippet-20160924.2001/snippets/python-mode/print
Normal file
5
elpa/yasnippet-20160924.2001/snippets/python-mode/print
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: print
|
||||
# key: p
|
||||
# --
|
||||
print($0)
|
17
elpa/yasnippet-20160924.2001/snippets/python-mode/prop
Normal file
17
elpa/yasnippet-20160924.2001/snippets/python-mode/prop
Normal file
@@ -0,0 +1,17 @@
|
||||
# contributor: Mads D. Kristensen <madsdk@gmail.com>
|
||||
# name: prop
|
||||
# --
|
||||
def ${1:foo}():
|
||||
doc = """${2:Doc string}"""
|
||||
def fget(self):
|
||||
return self._$1
|
||||
|
||||
def fset(self, value):
|
||||
self._$1 = value
|
||||
|
||||
def fdel(self):
|
||||
del self._$1
|
||||
return locals()
|
||||
$1 = property(**$1())
|
||||
|
||||
$0
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/reg
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/reg
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: reg
|
||||
# key: reg
|
||||
# group : general
|
||||
# --
|
||||
${1:regexp} = re.compile(r"${2:expr}")
|
||||
$0
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/repr
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/repr
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: __repr__
|
||||
# key: repr
|
||||
# group: dunder methods
|
||||
# --
|
||||
def __repr__(self):
|
||||
$0
|
5
elpa/yasnippet-20160924.2001/snippets/python-mode/return
Normal file
5
elpa/yasnippet-20160924.2001/snippets/python-mode/return
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: return
|
||||
# key: r
|
||||
# --
|
||||
return $0
|
11
elpa/yasnippet-20160924.2001/snippets/python-mode/script
Normal file
11
elpa/yasnippet-20160924.2001/snippets/python-mode/script
Normal file
@@ -0,0 +1,11 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: script
|
||||
# key: script
|
||||
# --
|
||||
#!/usr/bin/env python
|
||||
|
||||
def main():
|
||||
pass
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
6
elpa/yasnippet-20160924.2001/snippets/python-mode/self
Normal file
6
elpa/yasnippet-20160924.2001/snippets/python-mode/self
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: self
|
||||
# key: .
|
||||
# group: object oriented
|
||||
# --
|
||||
self.$0
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: self_without_dot
|
||||
# key: s
|
||||
# group: object oriented
|
||||
# --
|
||||
self
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: selfassign
|
||||
# key: sn
|
||||
# group: object oriented
|
||||
# --
|
||||
self.$1 = $1
|
5
elpa/yasnippet-20160924.2001/snippets/python-mode/setdef
Normal file
5
elpa/yasnippet-20160924.2001/snippets/python-mode/setdef
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: setdef
|
||||
# key: setdef
|
||||
# --
|
||||
${1:var}.setdefault(${2:key}, []).append(${3:value})
|
14
elpa/yasnippet-20160924.2001/snippets/python-mode/setup
Normal file
14
elpa/yasnippet-20160924.2001/snippets/python-mode/setup
Normal file
@@ -0,0 +1,14 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: setup
|
||||
# key: setup
|
||||
# group: distribute
|
||||
# --
|
||||
from setuptools import setup
|
||||
|
||||
package = '${1:name}'
|
||||
version = '${2:0.1}'
|
||||
|
||||
setup(name=package,
|
||||
version=version,
|
||||
description="${3:description}",
|
||||
url='${4:url}'$0)
|
5
elpa/yasnippet-20160924.2001/snippets/python-mode/size
Normal file
5
elpa/yasnippet-20160924.2001/snippets/python-mode/size
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: size
|
||||
# key: size
|
||||
# --
|
||||
sys.getsizeof($0)
|
6
elpa/yasnippet-20160924.2001/snippets/python-mode/static
Normal file
6
elpa/yasnippet-20160924.2001/snippets/python-mode/static
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: static
|
||||
# key: sm
|
||||
# --
|
||||
@staticmethod
|
||||
def ${1:func}($0):
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/str
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/str
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: __str__
|
||||
# key: str
|
||||
# group: dunder methods
|
||||
# --
|
||||
def __str__(self):
|
||||
$0
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/super
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/super
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: super
|
||||
# key: super
|
||||
# group: object oriented
|
||||
# --
|
||||
super(`(replace-regexp-in-string "\\([.]\\)[^.]+$" ", self)." (python-info-current-defun) nil nil 1)`($1)
|
||||
$0
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: test_class
|
||||
# key: tcs
|
||||
# group : testing
|
||||
# --
|
||||
class Test${1:toTest}(${2:unittest.TestCase}):
|
||||
$0
|
12
elpa/yasnippet-20160924.2001/snippets/python-mode/test_file
Normal file
12
elpa/yasnippet-20160924.2001/snippets/python-mode/test_file
Normal file
@@ -0,0 +1,12 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: test_file
|
||||
# key: tf
|
||||
# group : testing
|
||||
# --
|
||||
import unittest
|
||||
${1:from ${2:test_file} import *}
|
||||
|
||||
$0
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
6
elpa/yasnippet-20160924.2001/snippets/python-mode/trace
Normal file
6
elpa/yasnippet-20160924.2001/snippets/python-mode/trace
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: trace
|
||||
# key: tr
|
||||
# group: debug
|
||||
# --
|
||||
import pdb; pdb.set_trace()
|
8
elpa/yasnippet-20160924.2001/snippets/python-mode/try
Normal file
8
elpa/yasnippet-20160924.2001/snippets/python-mode/try
Normal file
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: try
|
||||
# key: try
|
||||
# --
|
||||
try:
|
||||
$1
|
||||
except ${2:Exception}:
|
||||
$0
|
10
elpa/yasnippet-20160924.2001/snippets/python-mode/tryelse
Normal file
10
elpa/yasnippet-20160924.2001/snippets/python-mode/tryelse
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: tryelse
|
||||
# key: try
|
||||
# --
|
||||
try:
|
||||
$1
|
||||
except $2:
|
||||
$3
|
||||
else:
|
||||
$0
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: __unicode__
|
||||
# key: un
|
||||
# group: dunder methods
|
||||
# --
|
||||
def __unicode__(self):
|
||||
$0
|
5
elpa/yasnippet-20160924.2001/snippets/python-mode/utf8
Normal file
5
elpa/yasnippet-20160924.2001/snippets/python-mode/utf8
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: utf-8 encoding
|
||||
# key: utf8
|
||||
# --
|
||||
# -*- coding: utf-8 -*-
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/while
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/while
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: while
|
||||
# key: wh
|
||||
# group: control structure
|
||||
# --
|
||||
while ${1:True}:
|
||||
$0
|
7
elpa/yasnippet-20160924.2001/snippets/python-mode/with
Normal file
7
elpa/yasnippet-20160924.2001/snippets/python-mode/with
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: with
|
||||
# key: with
|
||||
# group : control structure
|
||||
# --
|
||||
with ${1:expr}${2: as ${3:alias}}:
|
||||
$0
|
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: with_statement
|
||||
# key: fw
|
||||
# group: future
|
||||
# --
|
||||
from __future__ import with_statement
|
Reference in New Issue
Block a user