aboutsummaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authorpetitviolet <violethero0820@gmail.com>2014-03-04 10:18:00 +0900
committerpetitviolet <violethero0820@gmail.com>2014-03-04 10:21:39 +0900
commit66dea09d78278ecb8363bdd26df045f9d0f200d5 (patch)
treef7d048561c1c62c4de5beb56b0d5af8abc87731d /template
parent4c5bc730fce163ecdcd4c2bf39526461605a9694 (diff)
downloadvim-sonictemplate-66dea09d78278ecb8363bdd26df045f9d0f200d5.tar.gz
vim-sonictemplate-66dea09d78278ecb8363bdd26df045f9d0f200d5.tar.bz2
vim-sonictemplate-66dea09d78278ecb8363bdd26df045f9d0f200d5.zip
modified python template
add __repr__ function to *-class.py add encoding declaration to base-*.py remove vim-encoding declaration from base-main.py
Diffstat (limited to 'template')
-rw-r--r--template/python/base-class.py8
-rw-r--r--template/python/base-main.py2
-rw-r--r--template/python/base-test.py1
-rw-r--r--template/python/snip-class.py8
4 files changed, 11 insertions, 8 deletions
diff --git a/template/python/base-class.py b/template/python/base-class.py
index 9ea3b27..0aa20ea 100644
--- a/template/python/base-class.py
+++ b/template/python/base-class.py
@@ -1,7 +1,9 @@
+# -*- encoding: utf-8 -*-
"""
{{_name_}}
"""
+class {{_expr_:substitute('{{_input_:name}}(object)', '\w\+', '\u\0', '')}}:
+ def __init__(self{{_cursor_}}):
-class {{_expr_:substitute('{{_input_:name}}', '\w\+', '\u\0', '')}}:
- def __init__(self):
- {{_cursor_}}
+ def __repr__(self):
+ return
diff --git a/template/python/base-main.py b/template/python/base-main.py
index e40b7ba..5f8bd8d 100644
--- a/template/python/base-main.py
+++ b/template/python/base-main.py
@@ -1,5 +1,3 @@
-# vim: fileencoding=utf-8
-
def main():
{{_cursor_}}
diff --git a/template/python/base-test.py b/template/python/base-test.py
index 9f00533..089a0cb 100644
--- a/template/python/base-test.py
+++ b/template/python/base-test.py
@@ -1,3 +1,4 @@
+# -*- encoding: utf-8 -*-
"""
{{_name_}}
"""
diff --git a/template/python/snip-class.py b/template/python/snip-class.py
index c8ff23c..636204d 100644
--- a/template/python/snip-class.py
+++ b/template/python/snip-class.py
@@ -1,3 +1,5 @@
-class {{_expr_:substitute('{{_input_:name}}', '\w\+', '\u\0', '')}}:
- def __init__(self):
- {{_cursor_}}
+class {{_expr_:substitute('{{_input_:name}}(object)', '\w\+', '\u\0', '')}}:
+ def __init__(self{{_cursor_}}):
+
+ def __repr__(self):
+ return