diff options
author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2011-12-10 13:59:07 -0800 |
---|---|---|
committer | Chris Jerdonek <chris.jerdonek@gmail.com> | 2011-12-10 13:59:07 -0800 |
commit | 77f508bc626199dc746f4b63e741ba8b63a5a9a5 (patch) | |
tree | fbb61c2cee40066e241cb08ca5fffa900509c24d /pystache/init.py | |
parent | d2eab0f5b66cd7808e7f7c344995a78ac32de474 (diff) | |
parent | 8ca7408f6948f7a7214897d4a31b0a3aabaf8216 (diff) | |
download | pystache-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.py | 15 |
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() |