Corrected the path for somerights20.gif.
Removed all trailing whitespace. Added a few spaces here and there to improve readability. * src/plugins/NarrativeWeb.py svn: r10225
This commit is contained in:
parent
d7317da933
commit
c7226e1c04
@ -130,33 +130,34 @@ _CHARACTER_SETS = [
|
||||
|
||||
_CC = [
|
||||
'<a rel="license" href="http://creativecommons.org/licenses/by/2.5/">'
|
||||
'<img alt="Creative Commons License - By attribution" title="Creative '
|
||||
'Commons License - By attribution" src="somerights20.gif" /></a>',
|
||||
'<img alt="Creative Commons License - By attribution" '
|
||||
'title="Creative Commons License - By attribution" '
|
||||
'src="#PATH#images/somerights20.gif" /></a>',
|
||||
|
||||
'<a rel="license" href="http://creativecommons.org/licenses/by-nd/2.5/">'
|
||||
'<img alt="Creative Commons License - By attribution, No derivations" '
|
||||
'title="Creative Commons License - By attribution, No derivations" '
|
||||
'src="somerights20.gif" /></a>',
|
||||
'src="#PATH#images/somerights20.gif" /></a>',
|
||||
|
||||
'<a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/">'
|
||||
'<img alt="Creative Commons License - By attribution, Share-alike" '
|
||||
'title="Creative Commons License - By attribution, Share-alike" '
|
||||
'src="somerights20.gif" /></a>',
|
||||
'src="#PATH#images/somerights20.gif" /></a>',
|
||||
|
||||
'<a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/">'
|
||||
'<img alt="Creative Commons License - By attribution, Non-commercial" '
|
||||
'title="Creative Commons License - By attribution, Non-commercial" '
|
||||
'src="somerights20.gif" /></a>',
|
||||
'src="#PATH#images/somerights20.gif" /></a>',
|
||||
|
||||
'<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/2.5/">'
|
||||
'<img alt="Creative Commons License - By attribution, Non-commercial, No '
|
||||
'derivations" title="Creative Commons License - By attribution, '
|
||||
'Non-commercial, No derivations" src="somerights20.gif" /></a>',
|
||||
'<img alt="Creative Commons License - By attribution, Non-commercial, No derivations" '
|
||||
'title="Creative Commons License - By attribution, Non-commercial, No derivations" '
|
||||
'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="somerights20.gif" /></a>'
|
||||
'<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>'
|
||||
]
|
||||
|
||||
_COPY_OPTIONS = [
|
||||
@ -175,8 +176,10 @@ wrapper = TextWrapper()
|
||||
wrapper.break_log_words = True
|
||||
wrapper.width = 20
|
||||
|
||||
# This list of characters defines which hexadecimal entity certain 'special characters' with be transformed into for valid HTML rendering.
|
||||
# The variety of quotes with spaces are to assist in appropriately typesetting curly quotes and apostrophes.
|
||||
# This list of characters defines which hexadecimal entity certain
|
||||
# 'special characters' with be transformed into for valid HTML
|
||||
# rendering. The variety of quotes with spaces are to assist in
|
||||
# appropriately typesetting curly quotes and apostrophes.
|
||||
html_escape_table = {
|
||||
"&" : "&",
|
||||
' "' : " “",
|
||||
@ -189,7 +192,9 @@ html_escape_table = {
|
||||
">" : ">",
|
||||
"<" : "<",
|
||||
}
|
||||
# This command then defines the 'html_escape' option for escaping special characters for presentation in HTML based on the above list.
|
||||
|
||||
# This command then defines the 'html_escape' option for escaping
|
||||
# special characters for presentation in HTML based on the above list.
|
||||
def html_escape(text):
|
||||
"""Produce entities within text."""
|
||||
L=[]
|
||||
@ -197,6 +202,7 @@ def html_escape(text):
|
||||
L.append(html_escape_table.get(c,c))
|
||||
return "".join(L)
|
||||
|
||||
|
||||
class BasePage:
|
||||
def __init__(self, title, options, archive, photo_list, gid):
|
||||
self.title_str = title
|
||||
@ -733,10 +739,10 @@ class BasePage:
|
||||
return path
|
||||
|
||||
def build_name(self, path, base):
|
||||
name = base
|
||||
if path:
|
||||
return path + "/" + base + self.ext
|
||||
else:
|
||||
return base + self.ext
|
||||
name = path + "/" + name
|
||||
return name + self.ext
|
||||
|
||||
def person_link(self, of,path, name,gid="",up=True):
|
||||
if up:
|
||||
@ -794,8 +800,7 @@ class BasePage:
|
||||
|
||||
def place_link(self, of, handle, name,gid="",up=False):
|
||||
dirpath = self.build_path(handle,'plc',up)
|
||||
of.write('<a href="%s/%s%s">%s' % (
|
||||
dirpath,handle,self.ext,html_escape(name)))
|
||||
of.write('<a href="%s/%s%s">%s' % (dirpath, handle, self.ext, html_escape(name)))
|
||||
|
||||
if not self.noid and gid != "":
|
||||
of.write(' <span class="grampsid">[%s]</span>' % gid)
|
||||
@ -803,8 +808,7 @@ class BasePage:
|
||||
|
||||
def place_link_str(self, handle, name,gid="",up=False):
|
||||
dirpath = self.build_path(handle,'plc',up)
|
||||
retval = '<a href="%s/%s%s">%s' % (
|
||||
dirpath,handle,self.ext,html_escape(name))
|
||||
retval = '<a href="%s/%s%s">%s' % (dirpath, handle, self.ext, html_escape(name))
|
||||
|
||||
if not self.noid and gid != "":
|
||||
retval = retval + ' <span class="grampsid">[%s]</span>' % gid
|
||||
@ -1550,6 +1554,7 @@ class IntroductionPage(BasePage):
|
||||
of.write('alt="%s" />\n' % obj.get_description())
|
||||
except (IOError, OSError), msg:
|
||||
WarningDialog(_("Could not add photo to page"), str(msg))
|
||||
|
||||
if note_id:
|
||||
note_obj = db.get_note_from_gramps_id(note_id)
|
||||
text = note_obj.get(markup=True)
|
||||
@ -1584,7 +1589,6 @@ class HomePage(BasePage):
|
||||
|
||||
if pic_id:
|
||||
obj = db.get_object_from_gramps_id(pic_id)
|
||||
|
||||
mime_type = obj.get_mime_type()
|
||||
if mime_type and mime_type.startswith("image"):
|
||||
try:
|
||||
@ -1820,7 +1824,6 @@ class ContactPage(BasePage):
|
||||
if pic_id:
|
||||
obj = db.get_object_from_gramps_id(pic_id)
|
||||
mime_type = obj.get_mime_type()
|
||||
|
||||
if mime_type and mime_type.startswith("image"):
|
||||
try:
|
||||
(newpath, thumb_path) = self.copy_media(obj, False)
|
||||
@ -1828,7 +1831,6 @@ class ContactPage(BasePage):
|
||||
Utils.media_path_full(db,
|
||||
obj.get_path()),
|
||||
newpath)
|
||||
|
||||
of.write('\t\t<img height="200" ')
|
||||
of.write('src="%s" ' % newpath)
|
||||
of.write('alt="%s" />\n' % obj.get_description())
|
||||
|
Loading…
Reference in New Issue
Block a user