[PEAK] a potential patch for zconfig_loader

Dave Peticolas dave at krondo.com
Mon Jun 14 18:06:49 EDT 2004


Hello, I've been trying to get a 'hello, world' example working for
'peak EventDriven <zconfig file>' using a config file like:

%import hello

stopAfter 5

<Hello>
  RunEvery 1
  Priority 1
</Hello>

My 'hello' package contains a component.xml definition for the Hello task,
a simple extension of AdaptiveTask.

I was encountering a traceback due, I believe, to the fact that the 
ZConfig.loader.ConfigLoader base class of load_zconfig.ConfigLoader
was not being initialized. Attached is a patch that allowed me to get
things working. The traceback below occurs without the patch.

Traceback (most recent call last):
  File "./bin/peak", line 4, in ?
    commands.runMain( commands.Bootstrap )
  File "/home/dpeticol/python/lib/python2.3/site-packages/peak/running/commands.py",
line 70, in runMain
    result = factory().run()
  File "/home/dpeticol/python/lib/python2.3/site-packages/peak/running/commands.py",
line 98, in <lambda>
    factory = lambda: ob(config.makeRoot())
  File "/home/dpeticol/python/lib/python2.3/site-packages/peak/running/commands.py",
line 304, in __call__
    return cmd.interpret(cmd.argv[1])
  File "/home/dpeticol/python/lib/python2.3/site-packages/peak/running/commands.py",
line 629, in interpret
    return self.getSubcommand(factory)
  File "/home/dpeticol/python/lib/python2.3/site-packages/peak/running/commands.py",
line 275, in getSubcommand
    return super(AbstractInterpreter,self).getSubcommand(executable, **kw)
  File "/home/dpeticol/python/lib/python2.3/site-packages/peak/running/commands.py",
line 183, in getSubcommand
    return factory(**kw)
  File
"/home/dpeticol/python/lib/python2.3/site-packages/peak/config/load_zconfig.py", line
116, in factory
    return ConfigRunner(**kw)
  File "/home/dpeticol/python/lib/python2.3/site-packages/peak/running/commands.py",
line 304, in __call__
    return cmd.interpret(cmd.argv[1])
  File
"/home/dpeticol/python/lib/python2.3/site-packages/peak/config/load_zconfig.py", line
105, in interpret
    ob, handler = self.loadFile(factory.open('t'), str(url))
  File "/home/dpeticol/python/lib/python2.3/site-packages/ZConfig/loader.py", line
80, in loadFile
    return self.loadResource(r)
  File
"/home/dpeticol/python/lib/python2.3/site-packages/peak/config/load_zconfig.py", line
65, in loadResource
    dict([(k.lower(),v) for k,v in os.environ.items()])
  File "/home/dpeticol/python/lib/python2.3/site-packages/ZConfig/loader.py", line
234, in _parse_resource
    parser.parse(matcher)
  File "/home/dpeticol/python/lib/python2.3/site-packages/ZConfig/cfgparser.py", line
72, in parse
    self.handle_directive(section, line[1:])
  File "/home/dpeticol/python/lib/python2.3/site-packages/ZConfig/cfgparser.py", line
150, in handle_directive
    self.handle_import(section, arg)
  File "/home/dpeticol/python/lib/python2.3/site-packages/ZConfig/cfgparser.py", line
156, in handle_import
    self.context.importSchemaComponent(pkgname)
  File "/home/dpeticol/python/lib/python2.3/site-packages/ZConfig/loader.py", line
206, in importSchemaComponent
    if not self._private_schema:
AttributeError: 'ConfigRunner' object has no attribute '_private_schema'

-------------- next part --------------
A non-text attachment was scrubbed...
Name: peak.patch
Type: application/octet-stream
Size: 702 bytes
Desc: not available
Url : http://www.eby-sarna.com/pipermail/peak/attachments/20040614/59c7258d/peak.obj


More information about the PEAK mailing list