[Checkins]
SVN: grok/branches/philikon-ftest-layer-does-fixture-setup/src/grok/ftests/static
Had to rename 'grok.ftests.static' to 'grok.ftests.staticdir',
otherwise the grokker
Philipp von Weitershausen
philikon at philikon.de
Fri Aug 24 07:48:12 EDT 2007
Log message for revision 79222:
Had to rename 'grok.ftests.static' to 'grok.ftests.staticdir', otherwise the grokker
thinks 'static' is a resource directory.
Removed the grok.grok() line in simple.py.
Changed:
D grok/branches/philikon-ftest-layer-does-fixture-setup/src/grok/ftests/static/
A grok/branches/philikon-ftest-layer-does-fixture-setup/src/grok/ftests/staticdir/
U grok/branches/philikon-ftest-layer-does-fixture-setup/src/grok/ftests/staticdir/simple.py
-=-
Copied: grok/branches/philikon-ftest-layer-does-fixture-setup/src/grok/ftests/staticdir (from rev 79217, grok/trunk/src/grok/ftests/static)
Modified: grok/branches/philikon-ftest-layer-does-fixture-setup/src/grok/ftests/staticdir/simple.py
===================================================================
--- grok/trunk/src/grok/ftests/static/simple.py 2007-08-24 11:00:14 UTC (rev 79217)
+++ grok/branches/philikon-ftest-layer-does-fixture-setup/src/grok/ftests/staticdir/simple.py 2007-08-24 11:48:12 UTC (rev 79222)
@@ -2,12 +2,10 @@
If there is a static/ directory inside of a grokked package, its
contents will be available as static resources under a URL:
- >>> import grok
- >>> grok.grok('grok.ftests.static.simple_fixture')
>>> from zope.testbrowser.testing import Browser
>>> browser = Browser()
>>> browser.handleErrors = False
- >>> browser.open('http://localhost/@@/grok.ftests.static.simple_fixture/'
+ >>> browser.open('http://localhost/@@/grok.ftests.staticdir.simple_fixture/'
... 'file.txt')
>>> print browser.contents
some text
@@ -16,19 +14,19 @@
to resources:
>>> root = getRootFolder()
- >>> from grok.ftests.static.simple_fixture.ellie import Mammoth
+ >>> from grok.ftests.staticdir.simple_fixture.ellie import Mammoth
>>> root[u'ellie'] = Mammoth()
>>> browser.open('http://localhost/ellie')
>>> print browser.contents
<html>
<body>
- <a href="http://localhost/@@/grok.ftests.static.simple_fixture/file.txt">Some text in a file</a>
+ <a href="http://localhost/@@/grok.ftests.staticdir.simple_fixture/file.txt">Some text in a file</a>
</body>
</html>
Static also means that page templates will not be interpreted:
- >>> browser.open('http://localhost/@@/grok.ftests.static.simple_fixture/static.pt')
+ >>> browser.open('http://localhost/@@/grok.ftests.staticdir.simple_fixture/static.pt')
>>> print browser.contents
<html>
<body>
@@ -38,7 +36,7 @@
We also support subdirectories for resources:
- >>> browser.open('http://localhost/@@/grok.ftests.static.simple_fixture/subdir/otherfile.txt')
+ >>> browser.open('http://localhost/@@/grok.ftests.staticdir.simple_fixture/subdir/otherfile.txt')
>>> print browser.contents
This is yet another file.
More information about the Checkins
mailing list