1
0
mirror of https://github.com/gryf/.vim.git synced 2025-12-18 03:50:30 +01:00

Moved snippets to the bundle/snipmate directory

This commit is contained in:
Roman Dobosz
2012-03-20 14:43:14 +01:00
parent 2f7884c9d9
commit 1e1164cd0c
2 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,90 @@
snippet edbg
import sys
pydevdPath = r"c:\eclipse\plugins\org.python.pydev.debug_2.0.0.2011040403\pysrc"
if not pydevdPath in sys.path:
sys.path.append(pydevdPath)
import pydevd
pydevd.settrace()
snippet utimport
import pdunittest.common.pmxunittest as pmxunittest
snippet classt
class ${1:Foo}Tests(pmxunittest.TestCase):
"""
Tests for class $1 Tests
"""
def setUp(self):
"""
TODO: Setup test
"""
pass
def tearDown(self):
"""
TODO: Cleanup test
"""
pass
def test_${2:method}(self):
"""
Test $2 method of class $1
"""
${3:pass}
snippet runt
def run():
"""
runs unit tests in "interactive" mode
"""
suite1 = pmxunittest.TestLoader().loadTestsFromTestCase(${1:ClassTests})
suite = pmxunittest.TestSuite([suite1])
ret = pmxunittest.TextTestRunner().run(suite)
return ret
if __name__ == '__main__':
run()
# How to run manually:
#
# C:\> cd L:\runtime\pdpyapp
# C:\> L:
# L:\runtime\pdpyapp> startapp pdunittest\${2:`expand("%:t:r")`}
#
# Use parameters:
# -c (--changes) to check db changes after test run
# -c -r (--report) to gather detailed html report additionally
tested_modules = ['${3:module}'] # modules referenced by the test
automatic_run = ${4:True} # should it be run automatically?
execution_time = 0.000 # estimated time of test ru
snippet deft
def test_${1:fname}(self):
"""
Test for $1
"""
${2:pass}
snippet trace
import traceback
print "", 80*"-"
for _line in traceback.format_stack():
print _line.strip()
snippet pdlog
from PDLOG import PDLOG
PDLOG(${1:31337}, ${2:"msg"})
snippet head
"""
Project: 8202 / EBR
Description: ${2:description}
Created: ${3:00}.${4:2010}, ${5:author}
$RCSfile: ebrfoo.py,v $
$Source: /var/cvs/pmx/pylib/ebrfoo.py,v $
$Date: 2010/10/06 14:24:13 $
$Author: foo $
$Revision: 1.0 $
(c) Copyright ${6:2010} Rockwell Automation,
40-382 Katowice, Poland
"""
vcsid = "$Header: /var/cvs/pmx/pylib/ebrfoo.py,v 1.1 2009/10/06 14:24:13 foo Exp $"
${7}

View File

@@ -0,0 +1,88 @@
snippet #!
#!/usr/bin/python
snippet imp
import ${1:module}
# Module Docstring
snippet docs
'''
File: ${1:`Filename('$1.py', 'foo.py')`}
Author: ${2:`g:snips_author`}
Description: ${3}
'''
snippet wh
while ${1:condition}:
${2:# code...}
snippet for
for ${1:needle} in ${2:haystack}:
${3:# code...}
# New Class
snippet cl
class ${1:ClassName}(${2:object}):
"""${3:docstring for $1}"""
def __init__(self, ${4:arg}):
${5:super($1, self).__init__()}
self.$4 = $4
${6}
# New Function
snippet def
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
"""${3:docstring for $1}"""
${4:pass}
snippet deff
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
${3}
# New Method
snippet defs
def ${1:mname}(self, ${2:arg}):
${3:pass}
# New Property
snippet property
def ${1:foo}():
doc = "${2:The $1 property.}"
def fget(self):
${3:return self._$1}
def fset(self, value):
${4:self._$1 = value}
# Lambda
snippet ld
${1:var} = lambda ${2:vars} : ${3:action}
snippet .
self.
snippet try Try/Except
try:
${1:pass}
except ${2:Exception}, ${3:e}:
${4:raise $3}
snippet try Try/Except/Else
try:
${1:pass}
except ${2:Exception}, ${3:e}:
${4:raise $3}
else:
${5:pass}
snippet try Try/Except/Finally
try:
${1:pass}
except ${2:Exception}, ${3:e}:
${4:raise $3}
finally:
${5:pass}
snippet try Try/Except/Else/Finally
try:
${1:pass}
except ${2:Exception}, ${3:e}:
${4:raise $3}
else:
${5:pass}
finally:
${6:pass}
# if __name__ == '__main__':
snippet ifmain
if __name__ == '__main__':
${1:main()}
# __magic__
snippet _
__${1:init}__${2}
snippet dbg
import pywin.debugger; pywin.debugger.set_trace()