1
0
mirror of https://github.com/gryf/snipmate.vim.git synced 2025-12-19 20:38:05 +01:00

updated Python snippets

This commit is contained in:
Michael Sanders
2009-04-05 10:57:48 -04:00
parent 58c76810be
commit f3777f928f

View File

@@ -1,11 +1,12 @@
# #!/usr/bin/python
snippet #! snippet #!
#!/usr/bin/python #!/usr/bin/python
# While
snippet wh snippet wh
while ${1:condition}: while ${1:condition}:
${2:# code...} ${2:# code...}
snippet for
for ${1:needle} in ${2:haystack}:
${3:# code...}
# New Class # New Class
snippet cl snippet cl
class ${1:ClassName}(${2:object}): class ${1:ClassName}(${2:object}):
@@ -34,30 +35,26 @@ snippet property
# Self # Self
snippet . snippet .
self. self.
# Try/Except snippet try Try/Except
snippet try
try: try:
${1:pass} ${1:pass}
except ${2:Exception}, ${3:e}: except ${2:Exception}, ${3:e}:
${4:raise $3} ${4:raise $3}
# Try/Except/Else snippet try Try/Except/Else
snippet trye
try: try:
${1:pass} ${1:pass}
except ${2:Exception}, ${3:e}: except ${2:Exception}, ${3:e}:
${4:raise $3} ${4:raise $3}
else: else:
${5:pass} ${5:pass}
# Try/Except/Finally snippet try Try/Except/Finally
snippet tryf
try: try:
${1:pass} ${1:pass}
except ${2:Exception}, ${3:e}: except ${2:Exception}, ${3:e}:
${4:raise $3} ${4:raise $3}
finally: finally:
${5:pass} ${5:pass}
# Try/Except/Else/Finally snippet try Try/Except/Else/Finally
snippet tryef
try: try:
${1:pass} ${1:pass}
except ${2:Exception}, ${3:e}: except ${2:Exception}, ${3:e}: