rendered paste bodyuser@host:~> easy_install amara
....
user@host:~> te test.xml
~n
<?xml version="1.0"?>
<test>
<blah>123</blah>
<foo>yes</foo>
</test>
~s
~q
user@host:~> te test.py
~n
~p
import os
from amara import binderytools as bt
class config:
def LoadXML(self, config):
tmp = bt.bind_file(config + '.xml')
cf = os.path.basename(config)
self.__dict__[cf] = getattr(tmp, cf)
conf = config()
conf.LoadXML('./test')
print "conf.test.blah: " + str(conf.test.blah)
print "conf.test.foo: " + str(conf.test.foo)
~s
~q