6290: No Text report with output format PDF is created

6292: No Text report, with output format Print... , is created.


svn: r21064
This commit is contained in:
Benny Malengier 2013-01-11 14:51:28 +00:00
parent 549434612e
commit ce7192c034
4 changed files with 14 additions and 8 deletions

1
README
View File

@ -8,6 +8,7 @@ The following packages *MUST* be installed in order for Gramps to work:
Python 2.7 or greater, Python 3.2 or greater (python version cannot be mixed)
GTK 3.0 or greater
pygobject 3.3.2 or greater
cairo, pango, pangocairo with instrospection bindings (the gi packages)
librsvg2 (svg icon view)
xdg-utils

View File

@ -239,12 +239,12 @@ def show_settings():
try:
from gi.repository import GObject
try:
gobjectver_str = '%d.%d.%d' % GObject.pygobject_version
pygobjectver_str = '%d.%d.%d' % GObject.pygobject_version
except :# any failure to 'get' the version
gobjectver_str = 'unknown version'
pygobjectver_str = 'unknown version'
except ImportError:
gobjectver_str = 'not found'
pygobjectver_str = 'not found'
try:
from gi.repository import Pango
@ -350,7 +350,7 @@ def show_settings():
print (' python : %s' % py_str)
print (' gramps : %s' % gramps_str)
print (' gtk++ : %s' % gtkver_str)
print (' gobject : %s' % gobjectver_str)
print (' pygobject : %s' % pygobjectver_str)
print (' pango : %s' % pangover_str)
if usebsddb3:
print (' Using bsddb3')

View File

@ -86,7 +86,9 @@ class PdfDoc(libcairodoc.CairoDoc):
top_margin = self.paper.get_top_margin() * DPI / 2.54
# create cairo context and pango layout
filename = self._backend.filename.encode(sys.getfilesystemencoding())
filename = self._backend.filename
if sys.version_info[0] < 3:
filename = filename.encode(sys.getfilesystemencoding())
try:
surface = cairo.PDFSurface(filename, paper_width, paper_height)
except IOError as msg:

View File

@ -30,13 +30,12 @@
"""Report output generator based on Cairo.
"""
from __future__ import division
from __future__ import division, print_function
#------------------------------------------------------------------------
#
# Python modules
#
#------------------------------------------------------------------------
from __future__ import print_function
from gramps.gen.ggettext import gettext as _
from math import radians
@ -47,6 +46,7 @@ import re
# Gramps modules
#
#------------------------------------------------------------------------
from gramps.gen.constfunc import conv_to_unicode, UNITYPE
from gramps.gen.plug.docgen import (BaseDoc, TextDoc, DrawDoc, ParagraphStyle,
TableCellStyle, SOLID, FONT_SANS_SERIF, FONT_SERIF,
FONT_MONOSPACE, PARA_ALIGN_CENTER, PARA_ALIGN_LEFT)
@ -502,7 +502,10 @@ class GtkDocParagraph(GtkDocBaseElement):
"""
Internal method to allow for splitting of paragraphs
"""
self._plaintext = plaintext
if not isinstance(plaintext, UNITYPE):
self._plaintext = conv_to_unicode(plaintext, 'utf-8')
else:
self._plaintext = plaintext
def __set_attrlist(self, attrlist):
"""