From d0b7be73ff11c02ba3fe1d16b27bacfe06ddf928 Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Sun, 21 May 2006 20:39:14 +0000 Subject: [PATCH] src/plugins/GraphViz.py.in: fix file open. svn: r6737 --- ChangeLog | 3 +++ src/plugins/GraphViz.py | 26 ++++++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ecd75204..84ac3f60e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2006-05-21 Brian Matherly + * src/plugins/GraphViz.py.in: fix file open. + 2006-05-21 Alex Roitman * src/const.py.in: Use gettext. * src/GrampsDb/_ConstXML.py: Remove file. diff --git a/src/plugins/GraphViz.py b/src/plugins/GraphViz.py index 44b27ca0b..494255bd1 100644 --- a/src/plugins/GraphViz.py +++ b/src/plugins/GraphViz.py @@ -236,6 +236,7 @@ class GraphViz: self.filter = filters[filter_num] the_buffer = self.get_report() + self.f = open(options_class.get_output(),'w') if self.latin: self.f.write(the_buffer.encode('iso-8859-1')) else: @@ -523,18 +524,19 @@ just use iconv: cause empty string """ - if event.get_date_object().get_year_valid(): - if self.just_years: - return '%i' % event.get_date_object().get_year() - else: - return DateHandler.get_date(event) - elif self.placecause: - place_handle = event.get_place_handle() - place = self.database.get_place_from_handle(place_handle) - if place and place.get_title(): - return place.get_title() - else: - return event.get_cause() + if event: + if event.get_date_object().get_year_valid(): + if self.just_years: + return '%i' % event.get_date_object().get_year() + else: + return DateHandler.get_date(event) + elif self.placecause: + place_handle = event.get_place_handle() + place = self.database.get_place_from_handle(place_handle) + if place and place.get_title(): + return place.get_title() + else: + return event.get_cause() return ''