[Zope-Checkins] SVN: Products.Five/branches/1.5/ Merge 70924:70925 from 1.4 branch. Also sync the changelogs a bit, hopefully in the right way.

Brian Sutherland jinty at web.de
Fri Oct 27 04:39:03 EDT 2006


Log message for revision 70926:
  Merge 70924:70925 from 1.4 branch. Also sync the changelogs a bit, hopefully in the right way.

Changed:
  U   Products.Five/branches/1.5/CHANGES.txt
  U   Products.Five/branches/1.5/browser/resource.py
  U   Products.Five/branches/1.5/browser/tests/resource_ftest.txt
  A   Products.Five/branches/1.5/browser/tests/resource_subdir/

-=-
Modified: Products.Five/branches/1.5/CHANGES.txt
===================================================================
--- Products.Five/branches/1.5/CHANGES.txt	2006-10-27 08:33:41 UTC (rev 70925)
+++ Products.Five/branches/1.5/CHANGES.txt	2006-10-27 08:39:02 UTC (rev 70926)
@@ -16,6 +16,9 @@
 
 * Fixed #2168: Missing import
 
+* Port code from Zope 3 making resource directories recursive.
+  Thanks to Richard Waid.
+
 Five 1.5 (2006-08-13)
 =====================
 
@@ -95,6 +98,27 @@
   deprecated, as the functionality exists in the Zope core publisher
   from Zope 2.10 and up.
 
+Five 1.4.x
+==========
+
+Bugfixes
+--------
+
+* browser: processInputs now decodes strings in lists and tuples.
+
+* formlib: Removed redundant subpageform.pt and backported pageform.pt fixes
+  from Zope 3. Added missing error view and i18n configuration.
+
+* Made the __call__ method of ViewMixinForAttributes have the same signature
+  as the original attribute.  This aids some pathological request parameter
+  marshalling.
+
+* Backported Zope 2.10's pythonproducts zope app handling to help resolve
+  an issue with ConnectionStateError's.
+
+* Port code from Zope 3 making resource directories recursive.
+  Thanks to Richard Waid.
+
 Five 1.4.1 (2006-08-13)
 =======================
 
@@ -117,6 +141,15 @@
 
 * Added acquisition wrappers to viewlets before updating or rendering.
 
+Restructuring
+-------------
+
+* Enabled the viewlet related directives by default.
+
+* Added Five.browser.pagetemplatefile.ViewPageTemplateFile as an alias
+  to ZopeTwoPageTemplateFile and as a Zope 2 correspondence to
+  zope.app.pagetemplate.ViewPageTemplateFile.
+
 Five 1.4 (2006-05-29)
 =====================
 
@@ -179,6 +212,16 @@
   NOTE: Anyone who copied the Five site.zcml to their
   $INSTANCE_HOME/etc/ directory is going to need to update it.
 
+Five 1.3.8 (unreleased)
+=======================
+
+Bugfixes
+--------
+
+* Port code from Zope 3 making resource directories recursive.
+  Thanks to Richard Waid.
+
+
 Five 1.3.7 (2006-08-13)
 =======================
 

Modified: Products.Five/branches/1.5/browser/resource.py
===================================================================
--- Products.Five/branches/1.5/browser/resource.py	2006-10-27 08:33:41 UTC (rev 70925)
+++ Products.Five/branches/1.5/browser/resource.py	2006-10-27 08:39:02 UTC (rev 70926)
@@ -213,12 +213,20 @@
     def get(self, name, default=_marker):
         path = self.context.path
         filename = os.path.join(path, name)
-        if not os.path.isfile(filename):
+        isfile = os.path.isfile(filename)
+        isdir = os.path.isdir(filename)
+
+        if not (isfile or isdir):
             if default is _marker:
                 raise KeyError(name)
             return default
-        ext = name.split('.')[-1]
-        factory = self.resource_factories.get(ext, self.default_factory)
+
+        if isfile:
+            ext = name.split('.')[-1]
+            factory = self.resource_factories.get(ext, self.default_factory)
+        else:
+            factory = DirectoryResourceFactory
+
         resource = factory(name, filename)(self.request)
         resource.__name__ = name
         resource.__parent__ = self

Modified: Products.Five/branches/1.5/browser/tests/resource_ftest.txt
===================================================================
--- Products.Five/branches/1.5/browser/tests/resource_ftest.txt	2006-10-27 08:33:41 UTC (rev 70925)
+++ Products.Five/branches/1.5/browser/tests/resource_ftest.txt	2006-10-27 08:39:02 UTC (rev 70926)
@@ -66,6 +66,18 @@
   ...     self.assertEquals(200, response.getStatus())
 
 
+We also can traverse into sub-directories:
+
+  >>> print http(r'''
+  ... GET /test_folder_1_/testoid/++resource++fivetest_resources/resource_subdir/resource.txt HTTP/1.1
+  ... Authorization: Basic manager:r00t
+  ... ''')
+  HTTP/1.1 200 OK
+  ...
+  This is a resource in a subdirectory of a normal resource to test traversal.
+  <BLANKLINE>
+
+
 Clean up
 --------
 

Copied: Products.Five/branches/1.5/browser/tests/resource_subdir (from rev 70925, Products.Five/branches/1.4/browser/tests/resource_subdir)



More information about the Zope-Checkins mailing list