[Zope-Checkins] SVN: Zope/branches/2.12/ Handle resource files with .htm extention properly as page template resources.

Tres Seaver tseaver at palladion.com
Fri May 7 23:43:03 EDT 2010


Log message for revision 112179:
  Handle resource files with .htm extention properly as page template resources.
  
  LP #411837
  

Changed:
  U   Zope/branches/2.12/doc/CHANGES.rst
  U   Zope/branches/2.12/src/Products/Five/browser/resource.py
  U   Zope/branches/2.12/src/Products/Five/browser/tests/resource_ftest.txt
  A   Zope/branches/2.12/src/Products/Five/browser/tests/resource_subdir/resource.htm

-=-
Modified: Zope/branches/2.12/doc/CHANGES.rst
===================================================================
--- Zope/branches/2.12/doc/CHANGES.rst	2010-05-08 03:31:08 UTC (rev 112178)
+++ Zope/branches/2.12/doc/CHANGES.rst	2010-05-08 03:43:03 UTC (rev 112179)
@@ -36,6 +36,9 @@
 Bugs Fixed
 ++++++++++
 
+- LP #411837:  Handle resource files with ``.htm`` extention properly,
+  as page template resources.
+
 - LP #435728:  Fix indentation of OFSP/help/sequence.py docstring.
 
 - LP #574286:  Ensure that mailhosts which share a queue directory do not

Modified: Zope/branches/2.12/src/Products/Five/browser/resource.py
===================================================================
--- Zope/branches/2.12/src/Products/Five/browser/resource.py	2010-05-08 03:31:08 UTC (rev 112178)
+++ Zope/branches/2.12/src/Products/Five/browser/resource.py	2010-05-08 03:43:03 UTC (rev 112179)
@@ -132,6 +132,7 @@
         'pt':   PageTemplateResourceFactory,
         'zpt':  PageTemplateResourceFactory,
         'html': PageTemplateResourceFactory,
+        'htm':  PageTemplateResourceFactory,
         }
 
     default_factory = FileResourceFactory

Modified: Zope/branches/2.12/src/Products/Five/browser/tests/resource_ftest.txt
===================================================================
--- Zope/branches/2.12/src/Products/Five/browser/tests/resource_ftest.txt	2010-05-08 03:31:08 UTC (rev 112178)
+++ Zope/branches/2.12/src/Products/Five/browser/tests/resource_ftest.txt	2010-05-08 03:43:03 UTC (rev 112179)
@@ -92,6 +92,21 @@
   ...     response = self.publish(base_url % r, basic='manager:r00t')
   ...     self.assertEquals(200, response.getStatus())
 
+  >>> print http(r'''
+  ... GET /test_folder_1_/testoid/++resource++fivetest_resources/resource_subdir/resource.htm HTTP/1.1
+  ... Authorization: Basic manager:r00t
+  ... ''')
+  HTTP/1.1 200 OK
+  ...
+  <html>
+      <head>
+      </head>
+      <body>
+          This .html should not have a base tag automatically
+          added to the header.
+      </body>
+  </html>
+  <BLANKLINE>
 
 We also can traverse into sub-directories:
 

Added: Zope/branches/2.12/src/Products/Five/browser/tests/resource_subdir/resource.htm
===================================================================
--- Zope/branches/2.12/src/Products/Five/browser/tests/resource_subdir/resource.htm	                        (rev 0)
+++ Zope/branches/2.12/src/Products/Five/browser/tests/resource_subdir/resource.htm	2010-05-08 03:43:03 UTC (rev 112179)
@@ -0,0 +1,8 @@
+<html>
+    <head>
+    </head>
+    <body>
+        This .html should not have a base tag automatically
+        added to the header.
+    </body>
+</html>



More information about the Zope-Checkins mailing list