示例#1
0
    def _make_links(self,path):
        slash = '<font color="#FFFFFF">/</font><wbr>'
        links = path.split("/")
        html = """<table width="100%%">
<tr>
    <td align="left" width="639px">
    <img src="/mpx/images/nodebrowser_logo.png" width="175" height="142">
    </td>
    <td align="right" valign="top">
    <a class="home" href="/index.html">Home</a>&nbsp;
    </td>
</tr>
</table>
<table cellpadding="4" width="100%%">
<tr>
    <td align="left"
        bgcolor="%(bgcolor)s">%(slash)s<a href="/nodebrowser"
        class="node_path_link">nodebrowser</a>""" % {
            'slash':slash,
            'bgcolor':'#999999',
            }
        link = ""
        a = '/nodebrowser/'
        for l in links[1:]:
            a = posixpath.join(a, l)
            link = (
                '%s<a href="%s"\n   class="node_path_link">%s</a>' %
                (slash, a, urllib.unquote(l))
                )
            html += link
        html += '</td>\n</tr>\n</table>\n'
        html = html[:-1]
        return html
示例#2
0
文件: nodes.py 项目: mcruse/monotone
 def get_breadcrumbs(self, nodeurl):
     """
         Returns list of (name, node-URL) tuples providing the
         unencoded node names and full node URL for each node in
         the hierarchy.
     """
     segurl = '/'
     seglinks = []
     segments = nodeurl.split("/")
     for segment in segments[1:]:
         if segment:
             segurl = posixpath.join(segurl, segment)
             seglinks.append((urllib.unquote(segment), segurl))
     return [("nodes", "/")] + seglinks