* src/plugins/NarrativeWeb.py: wrap photo description at a maximum
of 20 characters to prevent overlap (bug #658) svn: r7880
This commit is contained in:
parent
a85bbf485e
commit
01f5d700d7
@ -2,6 +2,8 @@
|
|||||||
* src/SubstKeywords.py: Fix 0000813: IDs in graphical reports error
|
* src/SubstKeywords.py: Fix 0000813: IDs in graphical reports error
|
||||||
|
|
||||||
2007-01-07 Don Allingham <don@gramps-project.org>
|
2007-01-07 Don Allingham <don@gramps-project.org>
|
||||||
|
* src/plugins/NarrativeWeb.py: wrap photo description at a maximum
|
||||||
|
of 20 characters to prevent overlap (bug #658)
|
||||||
* src/RelLib/*.py: pylint fixes
|
* src/RelLib/*.py: pylint fixes
|
||||||
|
|
||||||
2007-01-07 Douglas S. Blank <dblank@cs.brynmawr.edu>
|
2007-01-07 Douglas S. Blank <dblank@cs.brynmawr.edu>
|
||||||
|
@ -38,6 +38,7 @@ import codecs
|
|||||||
import tarfile
|
import tarfile
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
from cStringIO import StringIO
|
from cStringIO import StringIO
|
||||||
|
from textwrap import TextWrapper
|
||||||
|
|
||||||
try:
|
try:
|
||||||
set()
|
set()
|
||||||
@ -134,6 +135,9 @@ _cc = [
|
|||||||
'<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/"><img alt="Creative Commons License - By attribution, Non-commerical, Share-alike" title="Creative Commons License - By attribution, Non-commerical, Share-alike" src="#PATH#images/somerights20.gif" /></a>',
|
'<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/"><img alt="Creative Commons License - By attribution, Non-commerical, Share-alike" title="Creative Commons License - By attribution, Non-commerical, Share-alike" src="#PATH#images/somerights20.gif" /></a>',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
wrapper = TextWrapper()
|
||||||
|
wrapper.break_log_words = True
|
||||||
|
wrapper.width = 20
|
||||||
|
|
||||||
class BasePage:
|
class BasePage:
|
||||||
def __init__(self, title, options, archive, photo_list, gid):
|
def __init__(self, title, options, archive, photo_list, gid):
|
||||||
@ -370,10 +374,10 @@ class BasePage:
|
|||||||
WarningDialog(_("Could not add photo to page"),str(msg))
|
WarningDialog(_("Could not add photo to page"),str(msg))
|
||||||
else:
|
else:
|
||||||
of.write('<div class="snapshot">\n')
|
of.write('<div class="snapshot">\n')
|
||||||
self.doc_link(of,photo_handle,
|
descr = " ".join(wrapper.wrap(photo.get_description()))
|
||||||
photo.get_description(),up=True)
|
self.doc_link(of, photo_handle, descr, up=True)
|
||||||
of.write('</div>\n')
|
of.write('</div>\n')
|
||||||
lnk = (self.cur_name,self.page_title,self.gid)
|
lnk = (self.cur_name, self.page_title, self.gid)
|
||||||
if self.photo_list.has_key(photo_handle):
|
if self.photo_list.has_key(photo_handle):
|
||||||
if lnk not in self.photo_list[photo_handle]:
|
if lnk not in self.photo_list[photo_handle]:
|
||||||
self.photo_list[photo_handle].append(lnk)
|
self.photo_list[photo_handle].append(lnk)
|
||||||
@ -394,14 +398,14 @@ class BasePage:
|
|||||||
if mime_type:
|
if mime_type:
|
||||||
try:
|
try:
|
||||||
(real_path,newpath) = self.copy_media(photo)
|
(real_path,newpath) = self.copy_media(photo)
|
||||||
self.media_link(of,photo_handle,newpath,
|
descr = " ".join(wrapper.wrap(photo.get_description()))
|
||||||
photo.get_description(),up=True)
|
self.media_link(of, photo_handle, newpath, descr, up=True)
|
||||||
except (IOError,OSError),msg:
|
except (IOError,OSError),msg:
|
||||||
WarningDialog(_("Could not add photo to page"),str(msg))
|
WarningDialog(_("Could not add photo to page"),str(msg))
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
self.doc_link(of,photo_handle,
|
descr = " ".join(wrapper.wrap(photo.get_description()))
|
||||||
photo.get_description(),up=True)
|
self.doc_link(of, photo_handle, descr, up=True)
|
||||||
lnk = (self.cur_name,self.page_title,self.gid)
|
lnk = (self.cur_name,self.page_title,self.gid)
|
||||||
if self.photo_list.has_key(photo_handle):
|
if self.photo_list.has_key(photo_handle):
|
||||||
if lnk not in self.photo_list[photo_handle]:
|
if lnk not in self.photo_list[photo_handle]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user