summaryrefslogtreecommitdiff
path: root/pystache/init.py
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2011-12-10 13:59:07 -0800
committerChris Jerdonek <chris.jerdonek@gmail.com>2011-12-10 13:59:07 -0800
commit77f508bc626199dc746f4b63e741ba8b63a5a9a5 (patch)
treefbb61c2cee40066e241cb08ca5fffa900509c24d /pystache/init.py
parentd2eab0f5b66cd7808e7f7c344995a78ac32de474 (diff)
parent8ca7408f6948f7a7214897d4a31b0a3aabaf8216 (diff)
downloadpystache-77f508bc626199dc746f4b63e741ba8b63a5a9a5.tar.gz
Merge pull request #29 (1) "code in __init__.py is evil"
From: https://github.com/kennethreitz/pystache/commit/8ca7408f6948f7a7214897d4a31b0a3aabaf8216 Into: issue_29 Moves code out of __init__.py into its own module. Changes from the original request: * Called the new module init.py instead of core.py. * Added a comment inside __init__.py. * Used editor-agnostic encoding line. * Fixed import line in view.py since nosetests was breaking.
Diffstat (limited to 'pystache/init.py')
-rw-r--r--pystache/init.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/pystache/init.py b/pystache/init.py
new file mode 100644
index 0000000..4544974
--- /dev/null
+++ b/pystache/init.py
@@ -0,0 +1,15 @@
+# encoding: utf-8
+
+from .template import Template
+from .view import View
+from .loader import Loader
+
+__all__ = ['Template', 'View', 'Loader', 'render']
+
+
+def render(template, context=None, **kwargs):
+
+ context = context and context.copy() or {}
+ context.update(kwargs)
+
+ return Template(template, context).render()