[Checkins] SVN: zc.resourcelibrary/trunk/ Make zope.app.publication dependency optional.

Brian Sutherland cvs-admin at zope.org
Wed Jan 23 12:42:18 UTC 2013


Log message for revision 129082:
  Make zope.app.publication dependency optional.
  

Changed:
  U   zc.resourcelibrary/trunk/CHANGES.txt
  U   zc.resourcelibrary/trunk/setup.py
  U   zc.resourcelibrary/trunk/src/zc/resourcelibrary/configure.zcml
  U   zc.resourcelibrary/trunk/src/zc/resourcelibrary/publication.py

-=-
Modified: zc.resourcelibrary/trunk/CHANGES.txt
===================================================================
--- zc.resourcelibrary/trunk/CHANGES.txt	2013-01-22 21:57:15 UTC (rev 129081)
+++ zc.resourcelibrary/trunk/CHANGES.txt	2013-01-23 12:42:17 UTC (rev 129082)
@@ -5,7 +5,7 @@
 1.3.5 (unreleased)
 ------------------
 
-- Nothing changed yet.
+- Make zope.app.publication dependency optional.
 
 
 1.3.4 (2012-01-20)

Modified: zc.resourcelibrary/trunk/setup.py
===================================================================
--- zc.resourcelibrary/trunk/setup.py	2013-01-22 21:57:15 UTC (rev 129081)
+++ zc.resourcelibrary/trunk/setup.py	2013-01-23 12:42:17 UTC (rev 129082)
@@ -58,7 +58,6 @@
                 'zope.testing',
                 ]),
       install_requires=['setuptools',
-                        'zope.app.publication',
                         'zope.browserpage',
                         'zope.browserresource',
                         'zope.component',

Modified: zc.resourcelibrary/trunk/src/zc/resourcelibrary/configure.zcml
===================================================================
--- zc.resourcelibrary/trunk/src/zc/resourcelibrary/configure.zcml	2013-01-22 21:57:15 UTC (rev 129081)
+++ zc.resourcelibrary/trunk/src/zc/resourcelibrary/configure.zcml	2013-01-23 12:42:17 UTC (rev 129082)
@@ -19,6 +19,7 @@
       />
 
   <utility
+      zcml:condition="installed zope.app.publication"
       component=".publication.Request"
       provides="zope.app.publication.interfaces.IBrowserRequestFactory"
       />

Modified: zc.resourcelibrary/trunk/src/zc/resourcelibrary/publication.py
===================================================================
--- zc.resourcelibrary/trunk/src/zc/resourcelibrary/publication.py	2013-01-22 21:57:15 UTC (rev 129081)
+++ zc.resourcelibrary/trunk/src/zc/resourcelibrary/publication.py	2013-01-23 12:42:17 UTC (rev 129082)
@@ -15,7 +15,6 @@
 $Id: publication.py 4528 2005-12-23 02:45:25Z gary $
 """
 from zope import interface
-from zope.app.publication.interfaces import IBrowserRequestFactory
 from zope.component import queryMultiAdapter, getMultiAdapter
 from zope.publisher.browser import BrowserRequest, BrowserResponse
 from zope.publisher.browser import isHTML
@@ -25,6 +24,11 @@
 import zc.resourcelibrary
 import zope.component.hooks
 
+try:
+    from zope.app.publication.interfaces import IBrowserRequestFactory
+except:
+    class IBrowserRequestFactory(interface.Interface):
+        pass
 
 class Request(BrowserRequest):
     interface.classProvides(IBrowserRequestFactory)
@@ -97,7 +101,7 @@
     def _implicitResult(self, body):
         #figure out the content type
         content_type = self.getHeader('content-type')
-        if content_type is None:
+        if content_type is None and self._status != 304:
             if isHTML(body):
                 content_type = 'text/html'
             else:



More information about the checkins mailing list