* src/plugins/GraphViz.py (GraphViz.__init__): Better error handling.
svn: r7052
This commit is contained in:
parent
f3fed49b9f
commit
705f6e2365
@ -1,4 +1,5 @@
|
|||||||
2006-07-20 Alex Roitman <shura@gramps-project.org>
|
2006-07-20 Alex Roitman <shura@gramps-project.org>
|
||||||
|
* src/plugins/GraphViz.py (GraphViz.__init__): Better error handling.
|
||||||
* src/plugins/IndivComplete.py: Use NameDisplay.
|
* src/plugins/IndivComplete.py: Use NameDisplay.
|
||||||
* src/plugins/FamilyGroup.py: Use NameDisplay.
|
* src/plugins/FamilyGroup.py: Use NameDisplay.
|
||||||
* src/GrampsCfg.py (add_name_panel): Minor UI improvements;
|
* src/GrampsCfg.py (add_name_panel): Minor UI improvements;
|
||||||
|
@ -244,30 +244,23 @@ class GraphViz:
|
|||||||
|
|
||||||
the_buffer = self.get_report()
|
the_buffer = self.get_report()
|
||||||
|
|
||||||
encoding_problem = False
|
self.f = open(options_class.get_output(),'w')
|
||||||
try:
|
if self.latin:
|
||||||
self.f = open(options_class.get_output(),'w')
|
try:
|
||||||
self.f.write(the_buffer)
|
self.f.write(the_buffer.encode('iso-8859-1', 'strict'))
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
if self.latin:
|
|
||||||
self.f = open(options_class.get_output(),'w')
|
self.f = open(options_class.get_output(),'w')
|
||||||
self.f.write(the_buffer.encode('iso-8859-1', 'replace'))
|
self.f.write(the_buffer.encode('iso-8859-1', 'replace'))
|
||||||
encoding_problem = True
|
ErrorDialog(
|
||||||
else:
|
_("Your data contains characters that cannot be "
|
||||||
raise Errors.ReporError(
|
"converted to latin-1. These characters were "
|
||||||
_("Your data contains characters that cannot "
|
"replaced with the question marks in the output. "
|
||||||
"be displayed. Most likely this is caused "
|
"To get these characters properly displayed, "
|
||||||
"by the incorrect character encoding."))
|
"unselect latin-1 option and try again."))
|
||||||
|
else:
|
||||||
|
self.f.write(the_buffer)
|
||||||
self.f.close()
|
self.f.close()
|
||||||
|
|
||||||
if encoding_problem:
|
|
||||||
ErrorDialog(
|
|
||||||
_("Your data contains characters that cannot be "
|
|
||||||
"converted to latin-1. These characters were "
|
|
||||||
"replaced with the question marks in the output. "
|
|
||||||
"To get these characters properly displayed, "
|
|
||||||
"unselect latin-1 option and try again."))
|
|
||||||
|
|
||||||
def get_report(self):
|
def get_report(self):
|
||||||
"return string of the .dot file contents"
|
"return string of the .dot file contents"
|
||||||
self.person_handles = self.filter.apply(self.database,
|
self.person_handles = self.filter.apply(self.database,
|
||||||
|
Loading…
Reference in New Issue
Block a user