sync a few files in gramps40 and trunk

svn: r21603
This commit is contained in:
Paul Franklin 2013-03-10 21:51:52 +00:00
parent b60dbf2782
commit 55e2863a0b
5 changed files with 8 additions and 2 deletions

View File

@ -43,6 +43,7 @@ else:
#locale returns unicode in python 3
to_uni = lambda x, y: x
codeset = glocale.encoding
try:
month_to_int = {

View File

@ -36,6 +36,7 @@ import locale
import sys
import logging
LOG = logging.getLogger(".")
#-------------------------------------------------------------------------
#
# Gramps modules

View File

@ -47,6 +47,7 @@ import io
from ..constfunc import STRTYPE
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.get_translation().gettext
def safe_eval(exp):
# restrict eval to empty environment
return eval(exp, {})

View File

@ -277,4 +277,3 @@ def resize_to_jpeg_buffer(source, size, crop=None):
except:
pass
return data

View File

@ -56,6 +56,7 @@ from gi.repository import Gtk
#-------------------------------------------------------------------------
from gramps.gen.const import URL_MANUAL_PAGE, VERSION_DIR
from gramps.gen.config import config
from gramps.gen.constfunc import win
from ..managedwindow import ManagedWindow
from ..display import display_help, display_url
from .grampletpane import (AVAILABLE_GRAMPLETS,
@ -191,7 +192,10 @@ class GrampletBar(Gtk.Notebook):
"""
filename = self.configfile
try:
fp = open(filename, "w")
if win() and not sys.version_info[0] < 3:
fp = open(filename, "w", encoding='utf-8')
else:
fp = open(filename, "w")
except IOError:
print("Failed writing '%s'; gramplets not saved" % filename)
return