[PEAK] (Z)ConfigLoader gives me a tuple when I just want a component

Giles Brown giles_brown at hotmail.com
Thu Jun 8 08:56:01 EDT 2006

> -----Original Message-----
> From: Phillip J. Eby [mailto:pje at telecommunity.com] 
> I believe this should work:
> peak.naming.factories.myschema = \
>      naming.lookup(propertyMap, 
> "ref:zconfig.schema at pkfile:mypkg/Schema.xml")[0]

I get a TypeError for this being unindexable, but I tweaked the
answer and got the object out as desired.  The answer being.

[Named Services]
peak.naming.factories.myschema = \

myobject = naming.lookup(propertyMap, "ref:myschema at myobject.cfg")[0]

I'm not sure I understand why naming.lookup() works, but not
Is it because the operation of naming.Reference() relies on the kind of
repeated evaluation that comes from implementing ISmartProperty, but
that naming.lookup() actually does the lookup when the rule expression is
evaluated so that we can safely index the result of naming.lookup() but not
of naming.Reference()?


More information about the PEAK mailing list