Fixed listing of internet addresses in display_url_list() and class InternetAddressBook.

svn: r13512
This commit is contained in:
Rob G. Healey 2009-11-06 21:50:35 +00:00
parent e0dc1b74f3
commit 029a5a0026

View File

@ -1268,16 +1268,40 @@ class BasePage(object):
descr = url.get_description() descr = url.get_description()
if not descr: if not descr:
descr = uri descr = uri
if url.get_type() == UrlType.EMAIL and not uri.startswith("mailto:"): _type = url.get_type()
ordered += Html("li") + Html("a",descr, href = 'mailto:%s' % url)
elif url.get_type() == UrlType.WEB_HOME and not uri.startswith("http://"): uri = url.get_path()
ordered += Html("li") + Html("a", descr, href = 'http://%s' % url) descr = url.get_description()
if not descr:
descr = uri
elif url.get_type() == UrlType.WEB_FTP and not uri.startswith("ftp://"): list = Html("li")
ordered += Html("li") + Html("a", descr, href = 'ftp://%s' % url) ordered += list
# Email address
if _type == UrlType.EMAIL:
if not uri.startswith("mailto:"):
list += Html("a",descr, href = 'mailto: %s' % uri)
else:
list += Html("a", descr, href = "%s" % uri)
# Web Site address
elif _type == UrlType.WEB_HOME:
if not uri.startswith("http://"):
list += Html("a", descr, href = 'http://%s' % uri)
else:
list += Html("a", href = "%s" % uri)
# FTP server address
elif _type == UrlType.WEB_FTP:
if not uri.startswith("ftp://"):
list += Html("a", descr, href = 'ftp://%s' % uri)
else:
list += Html("a", drscr, href = "%s" % uri)
# custom type
else: else:
ordered += Html("li") + Html("a", descr, href = url) list += Html("a", descr, href = uri)
# return web links to its caller # return web links to its caller
return section return section
@ -4588,7 +4612,8 @@ class InternetAddressBook(BasePage):
tbody += trow tbody += trow
# Internet link type # Internet link type
trow += Html("td", str(url.get_type() ), class_ = "ColumnType", inline = True) _type = url.get_type()
trow += Html("td", str(_type), class_ = "ColumnType", inline = True)
if first: if first:
trow.attr = 'class = "BeginName"' trow.attr = 'class = "BeginName"'
@ -4606,25 +4631,33 @@ class InternetAddressBook(BasePage):
if not descr: if not descr:
descr = uri descr = uri
if url.get_type() == UrlType.EMAIL and not uri.startswith("mailto:"): tcell = Html("td", class_ = "ColumnLink")
trow += Html("td", class_ = "ColumnLink") + ( trow += tcell
Html("a",descr, href = 'mailto: %s' % url)
)
elif url.get_type() == UrlType.WEB_HOME and not uri.startswith("http://"): # Email address
trow += Html("td", class_ = "ColumnLink") + ( if _type == UrlType.EMAIL:
Html("a", descr, href = 'http://%s' % url) if not uri.startswith("mailto:"):
) tcell += Html("a",descr, href = 'mailto: %s' % uri)
else:
tcell += Html("a", descr, href = "%s" % uri)
elif url.get_type() == UrlType.WEB_FTP and not uri.startswith("ftp://"): # Web Site address
trow += Html("td", class_ = "ColumnLink") + ( elif _type == UrlType.WEB_HOME:
Html("a", descr, href = 'ftp://%s' % url) if not uri.startswith("http://"):
) tcell += Html("a", descr, href = 'http://%s' % uri)
else:
tcell += Html("a", href = "%s" % uri)
# FTP server address
elif _type == UrlType.WEB_FTP:
if not uri.startswith("ftp://"):
tcell += Html("a", descr, href = 'ftp://%s' % uri)
else:
tcell += Html("a", drscr, href = "%s" % uri)
# custom type
else: else:
trow += Html("td", class_ = "ColumnLink") + ( tcell += Html("a", descr, href = uri)
Html("a", descr, href = url)
)
# Add footer and clearline # Add footer and clearline
footer = self.write_footer() footer = self.write_footer()