mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Use correct xml library for kodi
This commit is contained in:
parent
bb0a539074
commit
fcc6e942ab
2 changed files with 11 additions and 11 deletions
|
@ -5,7 +5,7 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from lxml import etree
|
import xml.etree.ElementTree as etree
|
||||||
|
|
||||||
from kodi_six import xbmc
|
from kodi_six import xbmc
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ def sources():
|
||||||
LOG.exception(error)
|
LOG.exception(error)
|
||||||
|
|
||||||
tree = etree.ElementTree(xml)
|
tree = etree.ElementTree(xml)
|
||||||
tree.write(file, pretty_print=True)
|
tree.write(file)
|
||||||
|
|
||||||
|
|
||||||
def tvtunes_nfo(path, urls):
|
def tvtunes_nfo(path, urls):
|
||||||
|
@ -96,7 +96,7 @@ def tvtunes_nfo(path, urls):
|
||||||
etree.SubElement(xml, 'file').text = url
|
etree.SubElement(xml, 'file').text = url
|
||||||
|
|
||||||
tree = etree.ElementTree(xml)
|
tree = etree.ElementTree(xml)
|
||||||
tree.write(path, pretty_print=True)
|
tree.write(path)
|
||||||
|
|
||||||
|
|
||||||
def advanced_settings():
|
def advanced_settings():
|
||||||
|
@ -126,7 +126,7 @@ def advanced_settings():
|
||||||
video.remove(cleanonupdate)
|
video.remove(cleanonupdate)
|
||||||
|
|
||||||
tree = etree.ElementTree(xml)
|
tree = etree.ElementTree(xml)
|
||||||
tree.write(path, pretty_print=True)
|
tree.write(path)
|
||||||
|
|
||||||
dialog("ok", heading="{jellyfin}", line1=translate(33097))
|
dialog("ok", heading="{jellyfin}", line1=translate(33097))
|
||||||
xbmc.executebuiltin('RestartApp')
|
xbmc.executebuiltin('RestartApp')
|
||||||
|
|
|
@ -6,7 +6,7 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
from lxml import etree
|
import xml.etree.ElementTree as etree
|
||||||
|
|
||||||
from six.moves.urllib.parse import urlencode
|
from six.moves.urllib.parse import urlencode
|
||||||
from kodi_six import xbmc, xbmcvfs
|
from kodi_six import xbmc, xbmcvfs
|
||||||
|
@ -127,7 +127,7 @@ def verify_kodi_defaults():
|
||||||
xml = etree.parse(file).getroot()
|
xml = etree.parse(file).getroot()
|
||||||
xml.set('order', str(17 + index))
|
xml.set('order', str(17 + index))
|
||||||
tree = etree.ElementTree(xml)
|
tree = etree.ElementTree(xml)
|
||||||
tree.write(file, pretty_print=True)
|
tree.write(file)
|
||||||
|
|
||||||
playlist_path = xbmc.translatePath("special://profile/playlists/video")
|
playlist_path = xbmc.translatePath("special://profile/playlists/video")
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ class Views(object):
|
||||||
etree.SubElement(rule, 'value').text = view['Tag']
|
etree.SubElement(rule, 'value').text = view['Tag']
|
||||||
|
|
||||||
tree = etree.ElementTree(xml)
|
tree = etree.ElementTree(xml)
|
||||||
tree.write(file, pretty_print=True)
|
tree.write(file)
|
||||||
|
|
||||||
def add_nodes(self, path, view, mixed=False):
|
def add_nodes(self, path, view, mixed=False):
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ class Views(object):
|
||||||
self.node_all(xml)
|
self.node_all(xml)
|
||||||
|
|
||||||
tree = etree.ElementTree(xml)
|
tree = etree.ElementTree(xml)
|
||||||
tree.write(file, pretty_print=True)
|
tree.write(file)
|
||||||
|
|
||||||
def node_root(self, root, index):
|
def node_root(self, root, index):
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ class Views(object):
|
||||||
label.text = view['Name'] if not mixed else "%s (%s)" % (view['Name'], translate(view['Media']))
|
label.text = view['Name'] if not mixed else "%s (%s)" % (view['Name'], translate(view['Media']))
|
||||||
|
|
||||||
tree = etree.ElementTree(xml)
|
tree = etree.ElementTree(xml)
|
||||||
tree.write(file, pretty_print=True)
|
tree.write(file)
|
||||||
|
|
||||||
def node(self, folder, view):
|
def node(self, folder, view):
|
||||||
|
|
||||||
|
@ -462,7 +462,7 @@ class Views(object):
|
||||||
|
|
||||||
getattr(self, 'node_' + node)(xml) # get node function based on node type
|
getattr(self, 'node_' + node)(xml) # get node function based on node type
|
||||||
tree = etree.ElementTree(xml)
|
tree = etree.ElementTree(xml)
|
||||||
tree.write(file, pretty_print=True)
|
tree.write(file)
|
||||||
|
|
||||||
def add_dynamic_node(self, index, file, view, node, name, path):
|
def add_dynamic_node(self, index, file, view, node, name, path):
|
||||||
|
|
||||||
|
@ -484,7 +484,7 @@ class Views(object):
|
||||||
|
|
||||||
getattr(self, 'node_' + node)(xml, path)
|
getattr(self, 'node_' + node)(xml, path)
|
||||||
tree = etree.ElementTree(xml)
|
tree = etree.ElementTree(xml)
|
||||||
tree.write(file, pretty_print=True)
|
tree.write(file)
|
||||||
|
|
||||||
def node_all(self, root):
|
def node_all(self, root):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue