src/plugins/GraphViz.py.in: fix file open.

svn: r6737
This commit is contained in:
Brian Matherly 2006-05-21 20:39:14 +00:00
parent 0c2f2fdd11
commit 8b1298e7f7
2 changed files with 17 additions and 12 deletions

View File

@ -1,3 +1,6 @@
2006-05-21 Brian Matherly <brian@gramps-project.org>
* src/plugins/GraphViz.py.in: fix file open.
2006-05-21 Alex Roitman <shura@gramps-project.org> 2006-05-21 Alex Roitman <shura@gramps-project.org>
* src/const.py.in: Use gettext. * src/const.py.in: Use gettext.
* src/GrampsDb/_ConstXML.py: Remove file. * src/GrampsDb/_ConstXML.py: Remove file.

View File

@ -236,6 +236,7 @@ class GraphViz:
self.filter = filters[filter_num] self.filter = filters[filter_num]
the_buffer = self.get_report() the_buffer = self.get_report()
self.f = open(options_class.get_output(),'w')
if self.latin: if self.latin:
self.f.write(the_buffer.encode('iso-8859-1')) self.f.write(the_buffer.encode('iso-8859-1'))
else: else:
@ -523,18 +524,19 @@ just use iconv:
cause cause
empty string empty string
""" """
if event.get_date_object().get_year_valid(): if event:
if self.just_years: if event.get_date_object().get_year_valid():
return '%i' % event.get_date_object().get_year() if self.just_years:
else: return '%i' % event.get_date_object().get_year()
return DateHandler.get_date(event) else:
elif self.placecause: return DateHandler.get_date(event)
place_handle = event.get_place_handle() elif self.placecause:
place = self.database.get_place_from_handle(place_handle) place_handle = event.get_place_handle()
if place and place.get_title(): place = self.database.get_place_from_handle(place_handle)
return place.get_title() if place and place.get_title():
else: return place.get_title()
return event.get_cause() else:
return event.get_cause()
return '' return ''