From c31073e481f5d5b41bf836be413bf04f2f20221b Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 10 Jan 2013 21:33:57 -0500 Subject: 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. --- Mozo/MainWindow.py | 6 ++---- 1 file 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,]) -- cgit v1.2.1