~ubuntu-branches/ubuntu/utopic/gramps/utopic

« back to all changes in this revision

Viewing changes to gramps/plugins/view/pedigreeview.py

  • Committer: Package Import Robot
  • Author(s): Ross Gammon
  • Date: 2014-06-17 17:21:59 UTC
  • mto: (39.1.10 sid)
  • mto: This revision was merged to the branch mainline in revision 49.
  • Revision ID: package-import@ubuntu.com-20140617172159-p726lth3zkhpvkvw
Tags: upstream-4.0.4+dfsg
ImportĀ upstreamĀ versionĀ 4.0.4+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#-------------------------------------------------------------------------
32
32
from __future__ import unicode_literals, division
33
33
 
34
 
from gramps.gen.const import GRAMPS_LOCALE as glocale
35
 
_ = glocale.translation.sgettext
36
34
from cgi import escape
37
35
import math
38
36
import sys
77
75
from gramps.gen.constfunc import is_quartz, win
78
76
from gramps.gui.dialog import RunDatabaseRepair, ErrorDialog
79
77
from gramps.gui.utils import color_graph_box, hex_to_rgb_float, is_right_click
80
 
from gramps.gen.constfunc import STRTYPE
 
78
from gramps.gen.constfunc import STRTYPE, lin
 
79
from gramps.gen.const import GRAMPS_LOCALE as glocale
 
80
_ = glocale.translation.sgettext
81
81
 
82
82
#-------------------------------------------------------------------------
83
83
#
208
208
        self.img_surf = None    
209
209
        if image:
210
210
            image_path = self.get_image(dbstate, person)
211
 
            if sys.version_info[0] < 3 and isinstance(image_path, STRTYPE):
212
 
                image_path = image_path.encode(glocale.getfilesystemencoding())
213
211
            if image_path and os.path.exists(image_path):
214
 
                self.img_surf = cairo.ImageSurface.create_from_png(image_path)
 
212
                with open(image_path, 'rb') as image:
 
213
                    self.img_surf = cairo.ImageSurface.create_from_png(image)
215
214
 
216
215
        # enable mouse-over
217
216
        self.connect("enter-notify-event", self.cb_on_enter)