* src/plugins/NavWebPage.py: Catch invalid HomeNote object
svn: r4158
This commit is contained in:
parent
46da2d9a61
commit
1869866af9
@ -3,6 +3,7 @@
|
||||
HaveAltFamilies,HavePhotos,HaveChildren,NeverMarried,
|
||||
MultipleMarriages,NoBirthdate): Add filter rules.
|
||||
* src/gramps_main.py (init_filters): Add new filters to the menu.
|
||||
* src/plugins/NavWebPage.py: Catch invalid HomeNote object
|
||||
|
||||
2005-03-09 Don Allingham <don@gramps-project.org>
|
||||
* src/ChooseParents.py: Fix widget sensitivity problem, assign
|
||||
|
@ -398,24 +398,27 @@ class HomePage(BasePage):
|
||||
if note_id:
|
||||
obj = db.get_object_from_gramps_id(note_id)
|
||||
|
||||
if obj.get_mime_type()[0:5] == "image":
|
||||
newpath = obj.gramps_id + os.path.splitext(obj.get_path())[1]
|
||||
shutil.copyfile(obj.get_path(),
|
||||
os.path.join(html_dir,newpath))
|
||||
of.write('<div align="center">\n')
|
||||
of.write('<img border="0" ')
|
||||
of.write('src="%s" />' % newpath)
|
||||
of.write('</div>\n')
|
||||
if not obj:
|
||||
print "%s object not found" % note_id
|
||||
else:
|
||||
if obj.get_mime_type()[0:5] == "image":
|
||||
newpath = obj.gramps_id + os.path.splitext(obj.get_path())[1]
|
||||
shutil.copyfile(obj.get_path(),
|
||||
os.path.join(html_dir,newpath))
|
||||
of.write('<div align="center">\n')
|
||||
of.write('<img border="0" ')
|
||||
of.write('src="%s" />' % newpath)
|
||||
of.write('</div>\n')
|
||||
|
||||
note_obj = obj.get_note_object()
|
||||
if note_obj:
|
||||
text = note_obj.get()
|
||||
if note_obj.get_format():
|
||||
of.write('<pre>\n%s\n</pre>\n' % text)
|
||||
else:
|
||||
of.write('<p>')
|
||||
of.write('</p><p>'.join(text.split('\n')))
|
||||
of.write('</p>')
|
||||
note_obj = obj.get_note_object()
|
||||
if note_obj:
|
||||
text = note_obj.get()
|
||||
if note_obj.get_format():
|
||||
of.write('<pre>\n%s\n</pre>\n' % text)
|
||||
else:
|
||||
of.write('<p>')
|
||||
of.write('</p><p>'.join(text.split('\n')))
|
||||
of.write('</p>')
|
||||
|
||||
self.display_footer(of)
|
||||
of.close()
|
||||
|
Loading…
Reference in New Issue
Block a user