E&S CVS Commit: PEAK - Hierarchical contexts and composite namespaces work now. I had to refactor

pje at eby-sarna.com pje at eby-sarna.com
Fri Dec 6 16:48:01 EST 2002

Module Name:	PEAK
Committed By:	pje
Date:		Fri Dec  6 21:47:35 UTC 2002

Modified Files:
	PEAK/src/peak: peak.ini
	PEAK/src/peak/naming: contexts.py names.py
	PEAK/src/peak/naming/tests: __init__.py
Added Files:
	PEAK/src/peak/naming/factories: config_ctx.py

Log Message:
Hierarchical contexts and composite namespaces work now.  I had to refactor
some of the context base class internals to get this to work reasonably,
and there are now some new methods that can be overridden.  In the simple
case, overriding '_contextNNS()' lets you handle per-context NNS pointers.
(And in the really simple case, you can ignore it altogether.)  If you want
to support explicit NNS pointers, you can override _get_nns(), _bind_nns(),
and _unbind_nns() as well.

The rules of name arithmetic have changed slightly; any addition that
previously returned a composite name will now return a compound name, if it
is possible to do so without changing the meaning of the returned name.
Similarly, the parser for nesting a compound name inside a composite name,
will return just a compound name if possible/appropriate.

There are new 'naming.isBoundary()' and 'naming.crossesBoundary()' APIs
that can be used to check if a name is a terminal namespace boundary, or
crosses namespace boundaries, respectively.

The name parsing tests have been updated for arithmetic and parsing
changes, and also to use the new naming.parseURL() function instead of
performing partial retrievals on the names.

Finally, a new 'config:' URL scheme has been added, as a demo of the
finished hierarchy and composite name support.  For example,
'config:environ.TMP' refers to a 'PropertyContext()' for that property
namespace, but 'config:environ.TMP/' returns the value of 'environ.TMP'.
Similarly, 'naming.lookup("config:environ")["TMP/"]' returns the value,
while 'naming.lookup("config:environ")["TMP"]' is just another naming

To view diffs of this commit, you can use the following URL(s):

To generate a diff of this commit:
cvs rdiff -r1.23 -r1.24 PEAK/src/peak/peak.ini
cvs rdiff -r1.40 -r1.41 PEAK/src/peak/naming/contexts.py
cvs rdiff -r1.39 -r1.40 PEAK/src/peak/naming/names.py
cvs rdiff -r0 -r1.1 PEAK/src/peak/naming/factories/config_ctx.py
cvs rdiff -r1.6 -r1.7 PEAK/src/peak/naming/tests/__init__.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