diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2005-11-17 15:46:54 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2005-11-17 15:46:54 +0000 |
| commit | 9925392e576717cc0df070ace822a6f392808bb7 (patch) | |
| tree | 1124ce4ea79319bf60f916f2ba7c838a4da2cd5a /lib/python/Components/Timezones.py | |
| parent | ea2e46b48524f14bb53b87846c07aa97444a513a (diff) | |
| download | enigma2-9925392e576717cc0df070ace822a6f392808bb7.tar.gz enigma2-9925392e576717cc0df070ace822a6f392808bb7.zip | |
parsing for /etc/timezone.xml added
Diffstat (limited to 'lib/python/Components/Timezones.py')
| -rw-r--r-- | lib/python/Components/Timezones.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/python/Components/Timezones.py b/lib/python/Components/Timezones.py new file mode 100644 index 00000000..90b227f7 --- /dev/null +++ b/lib/python/Components/Timezones.py @@ -0,0 +1,33 @@ +from xml.sax import make_parser +from xml.sax.handler import ContentHandler + +class Timezones: + class parseTimezones(ContentHandler): + def __init__(self, timezones): + self.isPointsElement, self.isReboundsElement = 0, 0 + self.timezones = timezones + + def startElement(self, name, attrs): + print "Name: " + str(name) + if (name == "zone"): + self.timezones[attrs.get('name',"")] = attrs.get('zone',"") + #print "found sat " + attrs.get('name',"") + " " + str(attrs.get('position',"")) + #tpos = attrs.get('position',"") + #tname = attrs.get('name',"") + #self.satellites[tpos] = tname + #self.satList.append( (tname, tpos) ) + #self.parsedSat = int(tpos) + + def __init__(self): + self.timezones = {} + + self.readTimezonesFromFile() + + def readTimezonesFromFile(self): + parser = make_parser() + timezonesHandler = self.parseTimezones(self.timezones) + parser.setContentHandler(timezonesHandler) + parser.parse('/etc/timezone.xml') + + +timezones = Timezones() |
