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 = [
|
_CC = [
|
||||||
'<a rel="license" href="http://creativecommons.org/licenses/by/2.5/">'
|
'<a rel="license" href="http://creativecommons.org/licenses/by/2.5/">'
|
||||||
'<img alt="Creative Commons License - By attribution" title="Creative '
|
'<img alt="Creative Commons License - By attribution" '
|
||||||
'Commons License - By attribution" src="somerights20.gif" /></a>',
|
'title="Creative Commons License - By attribution" '
|
||||||
|
'src="#PATH#images/somerights20.gif" /></a>',
|
||||||
|
|
||||||
'<a rel="license" href="http://creativecommons.org/licenses/by-nd/2.5/">'
|
'<a rel="license" href="http://creativecommons.org/licenses/by-nd/2.5/">'
|
||||||
'<img alt="Creative Commons License - By attribution, No derivations" '
|
'<img alt="Creative Commons License - By attribution, No derivations" '
|
||||||
'title="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/">'
|
'<a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/">'
|
||||||
'<img alt="Creative Commons License - By attribution, Share-alike" '
|
'<img alt="Creative Commons License - By attribution, Share-alike" '
|
||||||
'title="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/">'
|
'<a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/">'
|
||||||
'<img alt="Creative Commons License - By attribution, Non-commercial" '
|
'<img alt="Creative Commons License - By attribution, Non-commercial" '
|
||||||
'title="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/">'
|
'<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/2.5/">'
|
||||||
'<img alt="Creative Commons License - By attribution, Non-commercial, No '
|
'<img alt="Creative Commons License - By attribution, Non-commercial, No derivations" '
|
||||||
'derivations" title="Creative Commons License - By attribution, '
|
'title="Creative Commons License - By attribution, Non-commercial, No derivations" '
|
||||||
'Non-commercial, No derivations" src="somerights20.gif" /></a>',
|
'src="#PATH#images/somerights20.gif" /></a>',
|
||||||
|
|
||||||
'<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/">'
|
'<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/">'
|
||||||
'<img alt="Creative Commons License - By attribution, Non-commerical, '
|
'<img alt="Creative Commons License - By attribution, Non-commerical, Share-alike" '
|
||||||
'Share-alike" title="Creative Commons License - By attribution, '
|
'title="Creative Commons License - By attribution, Non-commerical, Share-alike" '
|
||||||
'Non-commerical, Share-alike" src="somerights20.gif" /></a>'
|
'src="#PATH#images/somerights20.gif" /></a>'
|
||||||
]
|
]
|
||||||
|
|
||||||
_COPY_OPTIONS = [
|
_COPY_OPTIONS = [
|
||||||
@ -175,8 +176,10 @@ wrapper = TextWrapper()
|
|||||||
wrapper.break_log_words = True
|
wrapper.break_log_words = True
|
||||||
wrapper.width = 20
|
wrapper.width = 20
|
||||||
|
|
||||||
# This list of characters defines which hexadecimal entity certain 'special characters' with be transformed into for valid HTML rendering.
|
# This list of characters defines which hexadecimal entity certain
|
||||||
# The variety of quotes with spaces are to assist in appropriately typesetting curly quotes and apostrophes.
|
# '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 = {
|
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):
|
def html_escape(text):
|
||||||
"""Produce entities within text."""
|
"""Produce entities within text."""
|
||||||
L=[]
|
L=[]
|
||||||
@ -197,6 +202,7 @@ def html_escape(text):
|
|||||||
L.append(html_escape_table.get(c,c))
|
L.append(html_escape_table.get(c,c))
|
||||||
return "".join(L)
|
return "".join(L)
|
||||||
|
|
||||||
|
|
||||||
class BasePage:
|
class BasePage:
|
||||||
def __init__(self, title, options, archive, photo_list, gid):
|
def __init__(self, title, options, archive, photo_list, gid):
|
||||||
self.title_str = title
|
self.title_str = title
|
||||||
@ -733,10 +739,10 @@ class BasePage:
|
|||||||
return path
|
return path
|
||||||
|
|
||||||
def build_name(self, path, base):
|
def build_name(self, path, base):
|
||||||
|
name = base
|
||||||
if path:
|
if path:
|
||||||
return path + "/" + base + self.ext
|
name = path + "/" + name
|
||||||
else:
|
return name + self.ext
|
||||||
return base + self.ext
|
|
||||||
|
|
||||||
def person_link(self, of,path, name,gid="",up=True):
|
def person_link(self, of,path, name,gid="",up=True):
|
||||||
if up:
|
if up:
|
||||||
@ -794,8 +800,7 @@ class BasePage:
|
|||||||
|
|
||||||
def place_link(self, of, handle, name,gid="",up=False):
|
def place_link(self, of, handle, name,gid="",up=False):
|
||||||
dirpath = self.build_path(handle,'plc',up)
|
dirpath = self.build_path(handle,'plc',up)
|
||||||
of.write('<a href="%s/%s%s">%s' % (
|
of.write('<a href="%s/%s%s">%s' % (dirpath, handle, self.ext, html_escape(name)))
|
||||||
dirpath,handle,self.ext,html_escape(name)))
|
|
||||||
|
|
||||||
if not self.noid and gid != "":
|
if not self.noid and gid != "":
|
||||||
of.write(' <span class="grampsid">[%s]</span>' % 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):
|
def place_link_str(self, handle, name,gid="",up=False):
|
||||||
dirpath = self.build_path(handle,'plc',up)
|
dirpath = self.build_path(handle,'plc',up)
|
||||||
retval = '<a href="%s/%s%s">%s' % (
|
retval = '<a href="%s/%s%s">%s' % (dirpath, handle, self.ext, html_escape(name))
|
||||||
dirpath,handle,self.ext,html_escape(name))
|
|
||||||
|
|
||||||
if not self.noid and gid != "":
|
if not self.noid and gid != "":
|
||||||
retval = retval + ' <span class="grampsid">[%s]</span>' % gid
|
retval = retval + ' <span class="grampsid">[%s]</span>' % gid
|
||||||
@ -1550,6 +1554,7 @@ class IntroductionPage(BasePage):
|
|||||||
of.write('alt="%s" />\n' % obj.get_description())
|
of.write('alt="%s" />\n' % obj.get_description())
|
||||||
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))
|
||||||
|
|
||||||
if note_id:
|
if note_id:
|
||||||
note_obj = db.get_note_from_gramps_id(note_id)
|
note_obj = db.get_note_from_gramps_id(note_id)
|
||||||
text = note_obj.get(markup=True)
|
text = note_obj.get(markup=True)
|
||||||
@ -1584,7 +1589,6 @@ class HomePage(BasePage):
|
|||||||
|
|
||||||
if pic_id:
|
if pic_id:
|
||||||
obj = db.get_object_from_gramps_id(pic_id)
|
obj = db.get_object_from_gramps_id(pic_id)
|
||||||
|
|
||||||
mime_type = obj.get_mime_type()
|
mime_type = obj.get_mime_type()
|
||||||
if mime_type and mime_type.startswith("image"):
|
if mime_type and mime_type.startswith("image"):
|
||||||
try:
|
try:
|
||||||
@ -1820,7 +1824,6 @@ class ContactPage(BasePage):
|
|||||||
if pic_id:
|
if pic_id:
|
||||||
obj = db.get_object_from_gramps_id(pic_id)
|
obj = db.get_object_from_gramps_id(pic_id)
|
||||||
mime_type = obj.get_mime_type()
|
mime_type = obj.get_mime_type()
|
||||||
|
|
||||||
if mime_type and mime_type.startswith("image"):
|
if mime_type and mime_type.startswith("image"):
|
||||||
try:
|
try:
|
||||||
(newpath, thumb_path) = self.copy_media(obj, False)
|
(newpath, thumb_path) = self.copy_media(obj, False)
|
||||||
@ -1828,7 +1831,6 @@ class ContactPage(BasePage):
|
|||||||
Utils.media_path_full(db,
|
Utils.media_path_full(db,
|
||||||
obj.get_path()),
|
obj.get_path()),
|
||||||
newpath)
|
newpath)
|
||||||
|
|
||||||
of.write('\t\t<img height="200" ')
|
of.write('\t\t<img height="200" ')
|
||||||
of.write('src="%s" ' % newpath)
|
of.write('src="%s" ' % newpath)
|
||||||
of.write('alt="%s" />\n' % obj.get_description())
|
of.write('alt="%s" />\n' % obj.get_description())
|
||||||
|
Loading…
Reference in New Issue
Block a user