Hi i would like to ask You, is it possiabel to have this modules of python in 7025??
It is nice to parase some XML lists.
Hi i would like to ask You, is it possiabel to have this modules of python in 7025??
It is nice to parase some XML lists.
You can use xml.dom.minidom to parse and write xml files. It's already integrated in the images. You could also install pyxml, but it takes nearly 2 mb.
I don't recommend anyone to youse minidom for creating xml on dreamboxes.
As you are working on an embedded Device you should always think about performance and minidom uses LOTS of CPU-Time.
When having a look at some xml-creating components of enigma2 (including the webinterface, timers etc.) you'll soon recognize you won't find any usage of xml.minidom for creating xml.
Oh... we are talking about performance differences you can easily measure in seconds...
If i remeber it correct we had an performance improvement which was at about factor 5 to 10 when switching to "manually created xml" on the webinterface (searching the epg for all titles with the letter e).
The bigger the xml is, the more you'll recognize the difference.
Ok i used
from xml.dom import minidom
xmldoc = minidom.parse('sth.xml')
and it parese fast on Linux... need to check it on DM,
it is short sthlist.xml, with some attributes..
thx
i ve got last Question, how I can Read to eListboxEntry ( left, right changing)
to see
<?xml version="1.0" encoding="iso-8859-1"?>
<sthlist>
<test name="XXXXX" osdname="111" testscript="" />
<test name="ZZZZZ" osdname="222" testscript="" />
</sthlist>
and Read NAME attribute to eListBoxEntry - to changing left,right and see this ??
Any idea about this?
I ve got ready parser xml
<?xml version="1.0" encoding="iso-8859-1"?>
<sthlist>
<sth attribute1="XXXXX" attribute2="111" attribute3="" />
<sth attribute1="ZZZZZ" attribute2="222" attribute3="" />
</sthlist>
class SthList:
sth_list = []
def __init__(self):
self.reload()
def reload(self):
sthlist_file = os.path.exists('/tmp/test.xm')
sth_list = xmldoc.getElementsByTagName('sth')
self.sth_list.append (_("None"))
for list in lista_emu:
atr1= list.getAttribute("attribute1")
atr2 = list.getAttribute("attribute2")
atr3 = list.getAttribute("attribute3")
atr4 = list.getAttribute("attribut4")
def keyLeft(self):
self["entries"].handleKey(KEY_LEFT)
def keyRight(self):
self["entries"].handleKey(KEY_RIGHT)
Alles anzeigen
Any one tried make this working ?
for example just read all attribute1 lines, and put it into somethink like
new eListBox<eListBoxEntryText>(this);
I think it is Config Values ? - read attribute1="TEST"
and we see TEST and wehn we move right or left it will be changed - it depends how many lines we ve got ... any help ?
Thank you very much