summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <[email protected]>2013-01-10 21:33:57 -0500
committerAlexei Sorokin <[email protected]>2016-08-23 00:45:55 +0300
commitc31073e481f5d5b41bf836be413bf04f2f20221b (patch)
tree60ff838bc87fe3fe4ebd4efca8db3edd9788718d
parenta820b36d34cd875a41cb038a2373858d733395af (diff)
downloadmozo-c31073e481f5d5b41bf836be413bf04f2f20221b.tar.bz2
mozo-c31073e481f5d5b41bf836be413bf04f2f20221b.tar.xz
MainWindow: make property editing work again
It seems I was mixing up binary/unicode data again. Rather than copy manually by reading into memory, just use shutil to do a direct copy.
-rw-r--r--Mozo/MainWindow.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Mozo/MainWindow.py b/Mozo/MainWindow.py
index dc986b9..bf6affa 100644
--- a/Mozo/MainWindow.py
+++ b/Mozo/MainWindow.py
@@ -23,10 +23,10 @@ gi.require_version('Gdk', '3.0')
from gi.repository import GLib, Gio
from gi.repository import Gtk, Gdk, GdkPixbuf
import cgi
-import codecs
import os
import gettext
import subprocess
+import shutil
import urllib
try:
from Mozo import config
@@ -378,9 +378,7 @@ class MainWindow:
file_type = 'Menu'
if not os.path.isfile(file_path):
- data = open(item.get_desktop_file_path()).read()
- with codecs.open(file_path, 'w') as f:
- f.write(data)
+ shutil.copy(item.get_desktop_file_path(), file_path)
self.editor._MenuEditor__addUndo([(file_type, os.path.split(file_path)[1]),])
else:
self.editor._MenuEditor__addUndo([item,])