diff options
-rw-r--r-- | Mozo/MenuEditor.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Mozo/MenuEditor.py b/Mozo/MenuEditor.py index 71a76eb..339279f 100644 --- a/Mozo/MenuEditor.py +++ b/Mozo/MenuEditor.py @@ -65,9 +65,8 @@ class MenuEditor: def save(self, from_loading=False): for menu in ('applications', 'settings'): - fd = open(getattr(self, menu).path, 'w') - fd.write(re.sub("\n[\s]*([^\n<]*)\n[\s]*</", "\\1</", getattr(self, menu).dom.toprettyxml().replace('<?xml version="1.0" ?>\n', ''))) - fd.close() + with open(getattr(self, menu).path, 'w') as f: + f.write(getattr(self, menu).dom.toprettyxml()) if not from_loading: self.__loadMenus() |