[TransWarp] component config info

Joel Boehland joel at memes.com
Mon Feb 10 18:50:12 EST 2003

Hello Phillip,
Thanks for your explanation on loading 
config info for components. I just got 
it to work, and I thought I'd send a 
little code example to the list in case 
others aren't clear on this.

file conf/component.ini:

file componentconfigtest.py:

from peak.api import *

class ConfigComponent(binding.Component):
     def getKey(self):
         key = "mycomponent.dottedpath.somekey"	

if __name__ == "__main__":
     cc = ConfigComponent()
     key = cc.getKey()
     print key #should print "blah"

More information about the PEAK mailing list