aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2005-11-17 15:46:54 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2005-11-17 15:46:54 +0000
commit9925392e576717cc0df070ace822a6f392808bb7 (patch)
tree1124ce4ea79319bf60f916f2ba7c838a4da2cd5a /lib/python/Components
parentea2e46b48524f14bb53b87846c07aa97444a513a (diff)
downloadenigma2-9925392e576717cc0df070ace822a6f392808bb7.tar.gz
enigma2-9925392e576717cc0df070ace822a6f392808bb7.zip
parsing for /etc/timezone.xml added
Diffstat (limited to 'lib/python/Components')
-rw-r--r--lib/python/Components/Makefile.am2
-rw-r--r--lib/python/Components/SetupDevices.py1
-rw-r--r--lib/python/Components/Timezones.py33
-rw-r--r--lib/python/Components/__init__.py2
4 files changed, 36 insertions, 2 deletions
diff --git a/lib/python/Components/Makefile.am b/lib/python/Components/Makefile.am
index 15073741..0e1894aa 100644
--- a/lib/python/Components/Makefile.am
+++ b/lib/python/Components/Makefile.am
@@ -9,4 +9,4 @@ install_PYTHON = \
GUIComponent.py MenuList.py TextInput.py __init__.py MovieList.py \
InputDevice.py ServicePosition.py SetupDevices.py Harddisk.py \
AVSwitch.py Network.py RFmod.py DiskInfo.py NimManager.py Lcd.py \
- EpgList.py ScrollLabel.py
+ EpgList.py ScrollLabel.py Timezones.py
diff --git a/lib/python/Components/SetupDevices.py b/lib/python/Components/SetupDevices.py
index cb2badb0..003bba54 100644
--- a/lib/python/Components/SetupDevices.py
+++ b/lib/python/Components/SetupDevices.py
@@ -5,6 +5,7 @@ from config import ConfigSubsection
from config import ConfigSlider
from config import configSelection
from config import configText
+from Components.Timezones import timezones
def InitSetupDevices():
config.timezone = ConfigSubsection();
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()
diff --git a/lib/python/Components/__init__.py b/lib/python/Components/__init__.py
index ebc7f49f..ed74427a 100644
--- a/lib/python/Components/__init__.py
+++ b/lib/python/Components/__init__.py
@@ -6,4 +6,4 @@ __all__ = ["ActionMap", "Button", "Clock", "ConfigList", "EventInfo",
"components", "config", "TimerList", "TimeInput", "MovieList",
"InputDevice", "ServicePosition", "IPAddress", "VariableIP", "IPGateway",
"IPNameserver", "Network", "RFmon", "DiskInfo", "NimManager", "TimerEntry",
- "Lcd", "EpgList" "ScrollLabel"]
+ "Lcd", "EpgList" "ScrollLabel", "Timezones"]