diff options
author | R. Tyler Ballance <tyler@monkeypox.org> | 2009-11-16 21:09:13 -0800 |
---|---|---|
committer | R. Tyler Ballance <tyler@monkeypox.org> | 2009-11-16 21:09:13 -0800 |
commit | d9ce7916e309e2393d824e249f512d2629e5e181 (patch) | |
tree | 6b7ad5cd6292f6e017e048fbeb4551facbabd174 /docs/users_guide_2_src/eg_3.py | |
parent | e43765a679b84c52df875e9629d303e304af50a1 (diff) | |
download | python-cheetah-docs.tar.gz |
Revert "Delete the "old" docs directory to make way for fancy smancy sphinx"docs
This reverts commit 5dc95cfcd015628665d3672e56d0551943b5db6b.
Diffstat (limited to 'docs/users_guide_2_src/eg_3.py')
-rw-r--r-- | docs/users_guide_2_src/eg_3.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/users_guide_2_src/eg_3.py b/docs/users_guide_2_src/eg_3.py new file mode 100644 index 0000000..5c89a65 --- /dev/null +++ b/docs/users_guide_2_src/eg_3.py @@ -0,0 +1,18 @@ +from Cheetah.Template import Template + +#The namespaces list is a list of dictionaries and/or +#class instances. Search is for dictionary key or object +#attributes in this list +class X: + pass + + +x = X() +x.value3 = 3 +x.value4 = 4 + +tmpl = "$value1, $value2, $value3, $value4" +NS = [{'value1':1},{'value2':2}, x] + +t = Template.compile(source=tmpl)(namespaces=NS) +print t.respond() #1,2,3,4 |