summaryrefslogtreecommitdiff
path: root/Mozo/MenuEditor.py
diff options
context:
space:
mode:
Diffstat (limited to 'Mozo/MenuEditor.py')
-rw-r--r--Mozo/MenuEditor.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Mozo/MenuEditor.py b/Mozo/MenuEditor.py
index 512e7ef..8739d57 100644
--- a/Mozo/MenuEditor.py
+++ b/Mozo/MenuEditor.py
@@ -536,11 +536,19 @@ class MenuEditor:
return found
def __addXmlMenuElement(self, element, name, dom):
+ if isinstance(name, bytes):
+ name = name.decode('utf-8')
+
node = dom.createElement('Menu')
self.__addXmlTextElement(node, 'Name', name, dom)
return element.appendChild(node)
def __addXmlTextElement(self, element, name, text, dom):
+ if isinstance(name, bytes):
+ name = name.decode('utf-8')
+ if isinstance(text, bytes):
+ text = text.decode('utf-8')
+
for temp in element.childNodes:
if temp.nodeName == name:
if temp.childNodes[0].nodeValue == text:
@@ -551,6 +559,9 @@ class MenuEditor:
return element.appendChild(node)
def __addXmlFilename(self, element, dom, filename, type = 'Include'):
+ if isinstance(filename, bytes):
+ filename = filename.decode('utf-8')
+
# remove old filenames
for node in self.__getXmlNodesByName(['Include', 'Exclude'], element):
if node.childNodes[0].nodeName == 'Filename' and node.childNodes[0].childNodes[0].nodeValue == filename: