[Checkins] SVN: hurry.zoperesource/trunk/ Use a newer version of hurry.resource so we can get rid of a bit
Martijn Faassen
faassen at startifact.com
Wed Dec 16 12:48:29 EST 2009
Log message for revision 106648:
Use a newer version of hurry.resource so we can get rid of a bit
of code here.
Changed:
U hurry.zoperesource/trunk/CHANGES.txt
U hurry.zoperesource/trunk/buildout.cfg
U hurry.zoperesource/trunk/setup.py
U hurry.zoperesource/trunk/src/hurry/zoperesource/zopesupport.py
-=-
Modified: hurry.zoperesource/trunk/CHANGES.txt
===================================================================
--- hurry.zoperesource/trunk/CHANGES.txt 2009-12-16 17:44:53 UTC (rev 106647)
+++ hurry.zoperesource/trunk/CHANGES.txt 2009-12-16 17:48:28 UTC (rev 106648)
@@ -6,6 +6,9 @@
* Updated required packages.
+* Use a newer version of hurry.resource which can insert the snippets
+ into HTML itself.
+
0.3 (2008-12-05)
================
Modified: hurry.zoperesource/trunk/buildout.cfg
===================================================================
--- hurry.zoperesource/trunk/buildout.cfg 2009-12-16 17:44:53 UTC (rev 106647)
+++ hurry.zoperesource/trunk/buildout.cfg 2009-12-16 17:48:28 UTC (rev 106648)
@@ -1,6 +1,6 @@
[buildout]
develop = .
-parts = test
+parts = test releaser
versions = versions
[versions]
@@ -11,3 +11,7 @@
eggs =
hurry.zoperesource
hurry.zoperesource[test]
+
+[releaser]
+recipe = zc.recipe.egg
+eggs = zest.releaser
Modified: hurry.zoperesource/trunk/setup.py
===================================================================
--- hurry.zoperesource/trunk/setup.py 2009-12-16 17:44:53 UTC (rev 106647)
+++ hurry.zoperesource/trunk/setup.py 2009-12-16 17:48:28 UTC (rev 106648)
@@ -31,7 +31,7 @@
install_requires=[
'setuptools',
'grokcore.component',
- 'hurry.resource > 0.2',
+ 'hurry.resource >= 0.4',
'z3c.autoinclude',
'zope.app.component',
'zope.app.publication',
Modified: hurry.zoperesource/trunk/src/hurry/zoperesource/zopesupport.py
===================================================================
--- hurry.zoperesource/trunk/src/hurry/zoperesource/zopesupport.py 2009-12-16 17:44:53 UTC (rev 106647)
+++ hurry.zoperesource/trunk/src/hurry/zoperesource/zopesupport.py 2009-12-16 17:48:28 UTC (rev 106648)
@@ -10,7 +10,7 @@
from zope.publisher.browser import BrowserRequest, BrowserResponse, isHTML
from zope.app.publication.interfaces import IBrowserRequestFactory
-from hurry.resource import NeededInclusions, Library
+from hurry.resource import NeededInclusions, Library, render_topbottom_into_html
from hurry.resource.interfaces import ICurrentNeededInclusions, ILibraryUrl
class CurrentNeededInclusions(grok.GlobalUtility):
@@ -60,16 +60,8 @@
if content_type and content_type.split(';', 1)[0].lower() in (
'text/html', 'text/xml'):
# act on HTML and XML content only!
+ body = render_topbottom_into_html(body)
- needed = component.getUtility(ICurrentNeededInclusions)()
-
- top, bottom = needed.render_topbottom()
-
- if top:
- body = body.replace('<head>', '<head>\n %s\n' % top, 1)
- if bottom:
- body = body.replace('</body>', '%s</body>' % bottom, 1)
-
return super(Response, self)._implicitResult(body)
class NoRequestError(Exception):
More information about the checkins
mailing list