source: DPPP/kml/csml2kml/python/configuration.py @ 3204

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/DPPP/kml/csml2kml/python/configuration.py@3204
Revision 3204, 519 bytes checked in by mkochan, 13 years ago (diff)

Added config per CSML file

Line 
1from cElementTree import ElementTree, Element, SubElement
2
3class Configuration:
4
5    # Load / parse in the config file
6    def __init__(self, configFilename):
7        self.tree = ElementTree()
8        self.tree.parse(configFilename)
9        self.root = self.tree.getroot()
10
11    # Get the text value/content for a setting at some xPath. xPath cannot contain
12    # XML attribute specifiers due to older version of cElementTree package.
13    def get(self, xPath):
14        str = self.root.findtext(xPath)
15        return str
Note: See TracBrowser for help on using the repository browser.