[Checkins] SVN: Sandbox/cklinger/megrok.z3cpt/trunk/ Added README.txt and some tests
Christian Klinger
cklinger at novareto.de
Fri Aug 22 10:53:07 EDT 2008
Log message for revision 90129:
Added README.txt and some tests
Changed:
U Sandbox/cklinger/megrok.z3cpt/trunk/README.txt
U Sandbox/cklinger/megrok.z3cpt/trunk/src/megrok/z3cpt/tests/test_functional.py
U Sandbox/cklinger/megrok.z3cpt/trunk/src/megrok.z3cpt.egg-info/SOURCES.txt
-=-
Modified: Sandbox/cklinger/megrok.z3cpt/trunk/README.txt
===================================================================
--- Sandbox/cklinger/megrok.z3cpt/trunk/README.txt 2008-08-22 14:36:07 UTC (rev 90128)
+++ Sandbox/cklinger/megrok.z3cpt/trunk/README.txt 2008-08-22 14:53:07 UTC (rev 90129)
@@ -0,0 +1,41 @@
+megrok.z3cpt
+============
+
+This packages allows you to use z3c.pt in grok.Views.
+
+Please note the extension for the template is *.3pt
+
+Example 1:
+----------
+
+class Index(grok.View):
+ grok.name('view')
+ person=""
+
+ def update(self):
+ self.person="Christian"
+
+index = megrok.z3cpt.z3cPageTemplate("""
+ <html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:tal="http://xml.zope.org/namespaces/tal">
+ <div>
+ Hello World!
+ </div>
+ <span tal:content="view.person" />
+ </html>
+ """)
+
+Example 2:
+----------
+
+class IndexFS(grok.View):
+ pass # see app_templates/indexfs.3pt
+
+$cat app_templates/indexfs.3pt
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <div>
+ Hello World!
+ </div>
+</html>
+
+
Modified: Sandbox/cklinger/megrok.z3cpt/trunk/src/megrok/z3cpt/tests/test_functional.py
===================================================================
--- Sandbox/cklinger/megrok.z3cpt/trunk/src/megrok/z3cpt/tests/test_functional.py 2008-08-22 14:36:07 UTC (rev 90128)
+++ Sandbox/cklinger/megrok.z3cpt/trunk/src/megrok/z3cpt/tests/test_functional.py 2008-08-22 14:53:07 UTC (rev 90129)
@@ -11,14 +11,26 @@
>>> from zope.testbrowser.testing import Browser
>>> browser = Browser()
>>> browser.handleErrors = False
+
+Check an inline template
+
>>> browser.open('http://localhost/app/view')
>>> browser.contents
'...Hello World...'
-
+
+Check a template in ...templates directory
+
>>> browser.open('http://localhost/app/indexfs')
>>> browser.contents
'...Hello World...'
+Check some basic information about the page you visit:
+
+ >>> browser.url
+ 'http://localhost/app/indexfs'
+ >>> browser.headers.get('Status').upper()
+ '200 OK'
+
"""
import grok
import megrok.z3cpt
Modified: Sandbox/cklinger/megrok.z3cpt/trunk/src/megrok.z3cpt.egg-info/SOURCES.txt
===================================================================
--- Sandbox/cklinger/megrok.z3cpt/trunk/src/megrok.z3cpt.egg-info/SOURCES.txt 2008-08-22 14:36:07 UTC (rev 90128)
+++ Sandbox/cklinger/megrok.z3cpt/trunk/src/megrok.z3cpt.egg-info/SOURCES.txt 2008-08-22 14:53:07 UTC (rev 90129)
@@ -1,5 +1,6 @@
CHANGES.txt
README.txt
+bootstrap.py
buildout.cfg
setup.cfg
setup.py
@@ -14,6 +15,9 @@
src/megrok.z3cpt.egg-info/requires.txt
src/megrok.z3cpt.egg-info/top_level.txt
src/megrok/z3cpt/__init__.py
+src/megrok/z3cpt/ftesting.zcml
+src/megrok/z3cpt/meta.zcml
src/megrok/z3cpt/template.py
src/megrok/z3cpt/tests/__init__.py
-src/megrok/z3cpt/tests/test_functional.py
\ No newline at end of file
+src/megrok/z3cpt/tests/test_functional.py
+src/megrok/z3cpt/tests/test_functional_templates/indexfs.3pt
\ No newline at end of file
More information about the Checkins
mailing list