improve, now sending all configured values
[enigma2-plugins.git] / webinterface / src / WebComponents / Sources / Settings.py
1 from enigma import *
2 from Components import config as config_mod
3 from Components.config import config
4
5 import os
6 import struct
7 from struct import *
8
9 from Components.Sources.Source import Source
10
11 class Settings( Source):
12         
13     def __init__(self,session):
14         self.cmd = []
15         self.session = session
16         Source.__init__(self)
17
18     def handleCommand(self, cmd):
19         self.cmd = cmd
20         
21     def do_func(self):
22         result=[]
23         self.pickle_this("config", config.saved_value, result)
24         return result
25  
26     def pickle_this(self, prefix, topickle, result):
27         for (key, val) in topickle.items():
28             name = prefix + "." + key
29             if isinstance(val, dict):
30                 self.pickle_this(name, val, result)
31             elif isinstance(val, tuple):
32                 result.append([name,val[0]])
33             else:
34                 result.append([name,val])
35
36     list = property(do_func)
37     lut = {"Name": 0           
38            ,"Value": 1
39            }