Sadly, my brain just farted :(
How do I open an XML file with the framework, delete an element, and save it back again?
Seems like the XML class used by Plex is either limited, or I am :rolleyes:
And advice would be most welcome here
/Tommy
Sadly, my brain just farted :(
How do I open an XML file with the framework, delete an element, and save it back again?
Seems like the XML class used by Plex is either limited, or I am :rolleyes:
And advice would be most welcome here
/Tommy
But you are reading it already, that part is done.
Open(“xmlfilename”,w)
If (media != what we want removed)
Write( xml row )
So, you just write a new file.
Mode w completly overwritescurrent file so you have to write everything thats supposed to be there.
Open-write functions should be builtin.
So, do not use the xml class. Read the file, check each line, output each line to the file thats not what we want removed.
I've made an entry for the delsrt issuelog. https://github.com/ukdtom/DevTools.bundle/issues/7
I think it should work.. atleast it worked for me in a clean python environment. No inclusions of any modules or anything..
But you are reading it already, that part is done.
Open("xmlfilename",w)
If (media != what we want removed)
Write( xml row )
So, you just write a new file.
Mode w completly overwritescurrent file so you have to write everything thats supposed to be there.
Open-write functions should be builtin.
So, do not use the xml class. Read the file, check each line, output each line to the file thats not what we want removed.
That's correct....But I wanted to use the XML class from the Plex framework, if that could do such a thing
/T
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.