Merge pull request #715 from protream/master

Python: add a snippet to generate pocoo style module doc string
This commit is contained in:
Honza Pokorny 2016-04-18 06:44:01 -03:00
commit f98b1c09ac

View File

@ -245,6 +245,9 @@ def write_function_docstring(t, snip):
snip.rv += '\n' + snip.mkline('', indent='')
snip += triple_quotes(snip)
def get_dir_and_file_name(snip):
return os.getcwd().split('/')[-1] + '.' + snip.basename
endglobal
########################################
@ -687,4 +690,18 @@ ${1:${VISUAL:doc}}
`!p snip.rv = triple_quotes(snip)`
endsnippet
snippet pmdoc "pocoo style module doc string" b
# -*- coding: utf-8 -*-
"""
`!p snip.rv = get_dir_and_file_name(snip)`
`!p snip.rv = '~' * len(get_dir_and_file_name(snip))`
${1:YOURDOCSTRING}
:copyright: (c) `date +Y%` by ${2:YOURNAME}.
:license: ${3:YOURLICENSE}, see LICENSE for more details.
"""
$0
endsnippet
# vim:ft=snippets: