hurry.resource integration for Zope.
Project description
Zope integration for hurry.resource
This package provides Zope integration for hurry.resource. This means three taking care of three things:
maintain the needed resources throughout the request/response cycle.
know how to make a URL to a resource.
make so that resource references are automatically inserted in the HTML header.
This library fulfills these conditions for a Zope 3/Grok setup.
We’ll run through a few tests to demonstrate it. Note that the real code being tested is not in this document itself, but in the views described in ftesting.zcml.
We need to be in a request to make this work, so let’s up a request to a page we have set up in ftesting.zcml that should cause the inclusion of a single resource in its header:
>>> from zope.testbrowser.testing import Browser >>> browser = Browser() >>> browser.handleErrors = False >>> browser.open('http://localhost/hurry.zoperesource.test_single') >>> print browser.contents <html> <head> <script type="text/javascript" src="http://localhost/@@/foo/a.js"></script> <BLANKLINE> </head> <body> <p>the widget HTML itself</p> </body> </html>
If a resource happens to need another resource, this resource is also automatically included:
>>> browser.open('http://localhost/hurry.zoperesource.test_multiple') >>> print browser.contents <html> <head> <script type="text/javascript" src="http://localhost/@@/foo/a.js"></script> <script type="text/javascript" src="http://localhost/@@/foo/b.js"></script> <BLANKLINE> </head> <body> <p>the widget HTML itself</p> </body> </html>
CHANGES
0.1 (2008-10-11)
Initial public release.
Download
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file hurry.zoperesource-0.1.tar.gz
.
File metadata
- Download URL: hurry.zoperesource-0.1.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9addc4cd0a54690b2c1a671f12887a2f30fd262950e92b9b8c0a4316804a5841 |
|
MD5 | 0cb90084ff3a4e260f04e86fb091257d |
|
BLAKE2b-256 | 7dfc1b05fcaa0e1efd6e58f3ae9291bd2f1e6b88402e4e01ed8aab80dcf98ddd |