diff options
Diffstat (limited to 'toprettyxml-and-unicode-fixes.patch')
-rw-r--r-- | toprettyxml-and-unicode-fixes.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/toprettyxml-and-unicode-fixes.patch b/toprettyxml-and-unicode-fixes.patch new file mode 100644 index 000000000000..f18406444730 --- /dev/null +++ b/toprettyxml-and-unicode-fixes.patch @@ -0,0 +1,44 @@ +diff -aur alacarte-3.7.90/Alacarte/MenuEditor.py alacarte-3.7.90.new/Alacarte/MenuEditor.py +--- alacarte-3.7.90/Alacarte/MenuEditor.py 2013-02-16 03:23:57.000000000 +0200 ++++ alacarte-3.7.90.new/Alacarte/MenuEditor.py 2013-04-24 22:48:57.876017889 +0300 +@@ -21,6 +21,7 @@ + import xml.dom.minidom + import xml.parsers.expat + from gi.repository import GMenu, GLib ++from xml.dom.ext import PrettyPrint + from Alacarte import util + + def get_default_menu(): +@@ -54,7 +55,7 @@ + + def save(self): + with codecs.open(self.path, 'w', 'utf8') as f: +- f.write(self.dom.toprettyxml()) ++ PrettyPrint(self.dom, stream=f) + + def restoreToSystem(self): + self.restoreTree(self.tree.get_root_directory()) +@@ -262,6 +263,7 @@ + out_path = os.path.join(util.getUserItemPath(), file_id) + + contents, length = keyfile.to_data() ++ contents = unicode(contents, 'utf8') + + with codecs.open(out_path, 'w', 'utf8') as f: + f.write(contents) +@@ -402,6 +404,7 @@ + file_id = util.getUniqueFileId(keyfile.get_string(GLib.KEY_FILE_DESKTOP_GROUP, 'Name'), '.desktop') + + contents, length = keyfile.to_data() ++ contents = unicode(contents, 'utf8') + + path = os.path.join(util.getUserItemPath(), file_id) + with codecs.open(path, 'w', 'utf8') as f: +@@ -424,6 +427,7 @@ + util.fillKeyFile(keyfile, kwargs) + + contents, length = keyfile.to_data() ++ contents = unicode(contents, 'utf8') + + path = os.path.join(util.getUserDirectoryPath(), file_id) + with codecs.open(path, 'w', 'utf8') as f: |