Fix spelling throughout UltiSnips/python.snippets

This commit is contained in:
gfixler 2014-03-22 22:33:17 -07:00
parent 4b31551246
commit 16630a5c8e

View File

@ -68,7 +68,7 @@ def get_quoting_style(snip):
return SINGLE_QUOTES return SINGLE_QUOTES
return DOUBLE_QUOTES return DOUBLE_QUOTES
def tripple_quotes(snip): def triple_quotes(snip):
if get_quoting_style(snip) == SINGLE_QUOTES: if get_quoting_style(snip) == SINGLE_QUOTES:
return "'''" return "'''"
return '"""' return '"""'
@ -104,7 +104,7 @@ def format_return(style):
def write_docstring_args(args, snip): def write_docstring_args(args, snip):
if not args: if not args:
snip.rv += ' {0}'.format(tripple_quotes(snip)) snip.rv += ' {0}'.format(triple_quotes(snip))
return return
snip.rv += '\n' + snip.mkline('', indent='') snip.rv += '\n' + snip.mkline('', indent='')
@ -166,10 +166,10 @@ endglobal
snippet class "class with docstrings" b snippet class "class with docstrings" b
class ${1:MyClass}(${2:object}): class ${1:MyClass}(${2:object}):
`!p snip.rv = tripple_quotes(snip)`${3:Docstring for $1. }`!p snip.rv = tripple_quotes(snip)` `!p snip.rv = triple_quotes(snip)`${3:Docstring for $1. }`!p snip.rv = triple_quotes(snip)`
def __init__(self$4): def __init__(self$4):
`!p snip.rv = tripple_quotes(snip)`${5:@todo: to be defined1.}`!p `!p snip.rv = triple_quotes(snip)`${5:@todo: to be defined1.}`!p
snip.rv = "" snip.rv = ""
snip >> 2 snip >> 2
@ -178,7 +178,7 @@ args = get_args(t[4])
write_docstring_args(args, snip) write_docstring_args(args, snip)
if args: if args:
snip.rv += '\n' + snip.mkline('', indent='') snip.rv += '\n' + snip.mkline('', indent='')
snip += '{0}'.format(tripple_quotes(snip)) snip += '{0}'.format(triple_quotes(snip))
write_init_body(args, t[2], snip) write_init_body(args, t[2], snip)
` `
@ -189,7 +189,7 @@ endsnippet
snippet slotclass "class with slots and docstrings" b snippet slotclass "class with slots and docstrings" b
class ${1:MyClass}(${2:object}): class ${1:MyClass}(${2:object}):
`!p snip.rv = tripple_quotes(snip)`${3:Docstring for $1. }`!p snip.rv = tripple_quotes(snip)` `!p snip.rv = triple_quotes(snip)`${3:Docstring for $1. }`!p snip.rv = triple_quotes(snip)`
`!p `!p
snip >> 1 snip >> 1
args = get_args(t[4]) args = get_args(t[4])
@ -197,7 +197,7 @@ write_slots_args(args, snip)
` `
def __init__(self$4): def __init__(self$4):
`!p snip.rv = tripple_quotes(snip)`${5:@todo: to be defined.}`!p `!p snip.rv = triple_quotes(snip)`${5:@todo: to be defined.}`!p
snip.rv = "" snip.rv = ""
snip >> 2 snip >> 2
@ -206,7 +206,7 @@ args = get_args(t[4])
write_docstring_args(args, snip) write_docstring_args(args, snip)
if args: if args:
snip.rv += '\n' + snip.mkline('', indent='') snip.rv += '\n' + snip.mkline('', indent='')
snip += tripple_quotes(snip) snip += triple_quotes(snip)
write_init_body(args, t[2], snip) write_init_body(args, t[2], snip)
` `
@ -399,7 +399,7 @@ snippet def "function with docstrings" b
def ${1:function}(`!p def ${1:function}(`!p
if snip.indent: if snip.indent:
snip.rv = 'self' + (", " if len(t[2]) else "")`${2:arg1}): snip.rv = 'self' + (", " if len(t[2]) else "")`${2:arg1}):
`!p snip.rv = tripple_quotes(snip)`${4:@todo: Docstring for $1.}`!p `!p snip.rv = triple_quotes(snip)`${4:@todo: Docstring for $1.}`!p
snip.rv = "" snip.rv = ""
snip >> 1 snip >> 1
@ -410,7 +410,7 @@ if args:
style = get_style(snip) style = get_style(snip)
snip += format_return(style) snip += format_return(style)
snip.rv += '\n' + snip.mkline('', indent='') snip.rv += '\n' + snip.mkline('', indent='')
snip += tripple_quotes(snip) ` snip += triple_quotes(snip) `
${0:pass} ${0:pass}
endsnippet endsnippet
@ -436,7 +436,7 @@ endsnippet
snippet rwprop "Read write property" b snippet rwprop "Read write property" b
def ${1:name}(): def ${1:name}():
`!p snip.rv = tripple_quotes(snip) if t[2] else '' `!p snip.rv = triple_quotes(snip) if t[2] else ''
`${2:@todo: Docstring for $1.}`!p `${2:@todo: Docstring for $1.}`!p
if t[2]: if t[2]:
snip >> 1 snip >> 1
@ -445,7 +445,7 @@ if t[2]:
snip.rv += '\n' + snip.mkline('', indent='') snip.rv += '\n' + snip.mkline('', indent='')
snip += format_return(style) snip += format_return(style)
snip.rv += '\n' + snip.mkline('', indent='') snip.rv += '\n' + snip.mkline('', indent='')
snip += tripple_quotes(snip) snip += triple_quotes(snip)
else: else:
snip.rv = ""` snip.rv = ""`
def fget(self): def fget(self):
@ -564,7 +564,7 @@ endsnippet
snippet testcase "pyunit testcase" b snippet testcase "pyunit testcase" b
class Test${1:Class}(${2:unittest.TestCase}): class Test${1:Class}(${2:unittest.TestCase}):
`!p snip.rv = tripple_quotes(snip)`${3:Test case docstring.}`!p snip.rv = tripple_quotes(snip)` `!p snip.rv = triple_quotes(snip)`${3:Test case docstring.}`!p snip.rv = triple_quotes(snip)`
def setUp(self): def setUp(self):
${4:pass} ${4:pass}