E&S CVS Commit: PEAK - Added Zope 3-like "namespaces" to 'peak.web'. Path segments in a URL

pje at eby-sarna.com pje at eby-sarna.com
Thu Sep 30 15:30:01 EDT 2004


Module Name:	PEAK
Committed By:	pje
Date:		Thu Sep 30 19:29:17 UTC 2004

Modified Files:
	PEAK: CHANGES.txt
	PEAK/src/peak: peak.ini
	PEAK/src/peak/web: environ.py interfaces.py places.py publish.py
	    resources.py
	PEAK/src/peak/web/tests: test_environ.py

Log Message:
Added Zope 3-like "namespaces" to 'peak.web'.  Path segments in a URL
may be prefixed with '"++some_id++"' in order to invoke a corresponding
namespace handler registered under '"peak.web.namespaces.some_id".
Namespace handlers must implement 'web.INamespaceHandler', and they are
supplied with the original path segment as well as the separated namespace
and name.  Also, as in Zope 3, '"@@foo"' is a shortcut for '"++view++foo"'.
Builtin namespaces at this time include 'view', 'item', 'attr', 'skin', and
'resources'.  'skin' treats the rest of its path segment as a skin name,
and sets the current skin, and 'resources' begins traversal to resources
found in the current skin.  The other namespaces are as described at:

http://www.eby-sarna.com/pipermail/peak/2004-August/001712.html

Note, however, that this doesn't include the change to default traversal
described there, and there are a couple of other issues outstanding, like
defining permissions for views, and fixing legacy uses of "@@" in the
peak.web source.  We also don't have any registration mechanisms for easy
view declarations, or for setting up local "sites" or "sub-applications".

Also, this refactoring may break existing uses of 'web.traverseAttr', which
now has a completely different meaning and signature.


To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/PEAK/CHANGES.txt.diff?r1=1.145&r2=1.146
http://cvs.eby-sarna.com/PEAK/src/peak/peak.ini.diff?r1=1.144&r2=1.145
http://cvs.eby-sarna.com/PEAK/src/peak/web/environ.py.diff?r1=1.8&r2=1.9
http://cvs.eby-sarna.com/PEAK/src/peak/web/interfaces.py.diff?r1=1.32&r2=1.33
http://cvs.eby-sarna.com/PEAK/src/peak/web/places.py.diff?r1=1.30&r2=1.31
http://cvs.eby-sarna.com/PEAK/src/peak/web/publish.py.diff?r1=1.41&r2=1.42
http://cvs.eby-sarna.com/PEAK/src/peak/web/resources.py.diff?r1=1.28&r2=1.29
http://cvs.eby-sarna.com/PEAK/src/peak/web/tests/test_environ.py.diff?r1=1.6&r2=1.7

To generate a diff of this commit:
cvs rdiff -r1.145 -r1.146 PEAK/CHANGES.txt
cvs rdiff -r1.144 -r1.145 PEAK/src/peak/peak.ini
cvs rdiff -r1.8 -r1.9 PEAK/src/peak/web/environ.py
cvs rdiff -r1.32 -r1.33 PEAK/src/peak/web/interfaces.py
cvs rdiff -r1.30 -r1.31 PEAK/src/peak/web/places.py
cvs rdiff -r1.41 -r1.42 PEAK/src/peak/web/publish.py
cvs rdiff -r1.28 -r1.29 PEAK/src/peak/web/resources.py
cvs rdiff -r1.6 -r1.7 PEAK/src/peak/web/tests/test_environ.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




More information about the source-changes mailing list