* src/plugin/NavWebPage.py: HTML validation fixes

svn: r4938
This commit is contained in:
Martin Hawlisch 2005-07-15 07:47:36 +00:00
parent add5f946d9
commit d25f491654
2 changed files with 10 additions and 9 deletions

View File

@ -1,5 +1,5 @@
2005-07-15 Martin Hawlisch <Martin.Hawlisch@gmx.de> 2005-07-15 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/plugins/NavWebPage.py: Avoid some segfaults * src/plugins/NavWebPage.py: Avoid some segfaults; HTML validation fixes
* src/Utils.py (find_mime_type_pixbuf): Dont segfault with note only object * src/Utils.py (find_mime_type_pixbuf): Dont segfault with note only object
* src/SelectObject.py (on_select_row): Dont segfault with note only object * src/SelectObject.py (on_select_row): Dont segfault with note only object

View File

@ -211,7 +211,7 @@ class BasePage:
of.write('<div class="snapshot">\n') of.write('<div class="snapshot">\n')
of.write('<a href="%s.%s">' % (photo_handle,self.ext)) of.write('<a href="%s.%s">' % (photo_handle,self.ext))
of.write('<img class="thumbnail" border="0" src="%s" ' % newpath) of.write('<img class="thumbnail" border="0" src="%s" ' % newpath)
of.write('height="100"></a>') of.write('height="100" alt="%s"></a>' % photo.get_description())
of.write('</div>\n') of.write('</div>\n')
except (IOError,OSError),msg: except (IOError,OSError),msg:
ErrorDialog(str(msg)) ErrorDialog(str(msg))
@ -475,7 +475,7 @@ class MediaPage(BasePage):
try: try:
of.write('<div align="center">\n') of.write('<div align="center">\n')
of.write('<img border="0" ') of.write('<img border="0" ')
of.write('src="%s" />' % newpath) of.write('src="%s" alt="%s"/>' % (newpath, title))
of.write('</div>\n') of.write('</div>\n')
except (IOError,OSError),msg: except (IOError,OSError),msg:
ErrorDialog(str(msg)) ErrorDialog(str(msg))
@ -490,6 +490,7 @@ class MediaPage(BasePage):
of.write('<td class="data">%s</td>\n' % photo.mime) of.write('<td class="data">%s</td>\n' % photo.mime)
of.write('</tr>\n') of.write('</tr>\n')
of.write('</table>\n') of.write('</table>\n')
of.write('</div>\n')
self.display_note_object(of, photo.get_note_object()) self.display_note_object(of, photo.get_note_object())
@ -580,7 +581,7 @@ class IntroductionPage(BasePage):
newpath = self.copy_media(obj) newpath = self.copy_media(obj)
of.write('<div align="center">\n') of.write('<div align="center">\n')
of.write('<img border="0" ') of.write('<img border="0" ')
of.write('src="%s" />' % newpath) of.write('src="%s" alt="%s" />' % (newpath, obj.get_description()))
of.write('</div>\n') of.write('</div>\n')
except (IOError,OSError),msg: except (IOError,OSError),msg:
ErrorDialog(str(msg)) ErrorDialog(str(msg))
@ -625,7 +626,7 @@ class HomePage(BasePage):
newpath = self.copy_media(obj) newpath = self.copy_media(obj)
of.write('<div align="center">\n') of.write('<div align="center">\n')
of.write('<img border="0" ') of.write('<img border="0" ')
of.write('src="%s" />' % newpath) of.write('src="%s" alt="%s" />' % (newpath, obj.get_description()))
of.write('</div>\n') of.write('</div>\n')
except (IOError,OSError),msg: except (IOError,OSError),msg:
ErrorDialog(str(msg)) ErrorDialog(str(msg))
@ -677,7 +678,7 @@ class SourcesPage(BasePage):
of.write('</a></td></tr>\n') of.write('</a></td></tr>\n')
index += 1 index += 1
of.write('</table>\n<blockquote>\n') of.write('</table>\n</blockquote>\n')
self.display_footer(of) self.display_footer(of)
self.close_file(of) self.close_file(of)
@ -756,7 +757,7 @@ class GalleryPage(BasePage):
of.write('</td></tr>\n') of.write('</td></tr>\n')
index += 1 index += 1
of.write('</table>\n<blockquote>\n') of.write('</table>\n</blockquote>\n')
self.display_footer(of) self.display_footer(of)
self.close_file(of) self.close_file(of)
@ -819,7 +820,7 @@ class ContactPage(BasePage):
of.write('<table cellspacing="0" cellpadding="0" border="0"><tr>') of.write('<table cellspacing="0" cellpadding="0" border="0"><tr>')
of.write('<td height="205">') of.write('<td height="205">')
of.write('<img border="0" height="200" ') of.write('<img border="0" height="200" ')
of.write('src="%s.%s" />' % (note_id,self.ext)) of.write('src="%s.%s" alt="%s" />' % (note_id,self.ext,obj.get_description()))
of.write('</td></tr></table>\n') of.write('</td></tr></table>\n')
of.write('</div>\n') of.write('</div>\n')
except (IOError,OSError),msg: except (IOError,OSError),msg:
@ -1216,7 +1217,7 @@ class IndividualPage(BasePage):
text = text + " <sup>" text = text + " <sup>"
for handle in gid_list: for handle in gid_list:
src = self.db.get_source_from_handle(handle) src = self.db.get_source_from_handle(handle)
text = text + ' <a href="%s.%s">[%s]' % (handle,self.ext,src.gramps_id) text = text + ' <a href="%s.%s">[%s]</a>' % (handle,self.ext,src.gramps_id)
text = text + "</sup>" text = text + "</sup>"
return text return text