# # # patch "TODO" # from [c02b42866e7b219f3e62a23a963a4e6168eff1b7] # to [edde29b03eeb75ef9d0cc89c8295fbeb64c5fbad] # # patch "common.py" # from [8747244a363d332bf91522eb44258c4ecf5cbccc] # to [ec4c49fe7950195f6897ce813aafdbe043b1154c] # # patch "revision.psp" # from [3f198ce41986db92a1cc0a0373d92a87ddf8b71f] # to [77bab654be272a249a635cf03c34f88aed76a042] # ============================================================ --- TODO c02b42866e7b219f3e62a23a963a4e6168eff1b7 +++ TODO edde29b03eeb75ef9d0cc89c8295fbeb64c5fbad @@ -20,3 +20,6 @@ URL to get the latest tar file of a branch. +Improve the manifest; icons next to files indicating type (steal the +icons from GNOME?) + ============================================================ --- common.py 8747244a363d332bf91522eb44258c4ecf5cbccc +++ common.py ec4c49fe7950195f6897ce813aafdbe043b1154c @@ -1,4 +1,5 @@ +import urllib import pydoc escape_function = pydoc.HTMLRepr().escape @@ -11,6 +12,40 @@ else: return e(x) +def link(link_type, link_to, description = None): + hq = html_escape() + if link_type == "revision": + rv = '[' % (urllib.quote(link_to)) + if description != None: rv += hq(description) + else: rv += hq(link_to[:8]) + ".." + rv += ']' + return rv + elif link_type == "diff": + rv = '' % (urllib.quote(link_to[0]), urllib.quote(link_to[1])) + if description != None: rv += hq(description) + else: rv += "diff" + rv += '' + return rv + elif link_type == "file": + if type(link_to) == type([]): + rv = '' % (urllib.quote(link_to[0]), urllib.quote(link_to[1])) + link_id = link_to[0] + else: + raise Exception(link_to) + rv = '' % (urllib.quote(link_to)) + link_id = link_to + if description != None: rv += hq(description) + "" + else: rv = "[" + rv + hq(link_id[:8]) + ".." + "]" + return rv + elif link_type == "branch": + rv = '' % (urllib.quote(link_to)) + if description != None: rv += hq(description) + else: rv += hq(link_to) + rv += '' + return rv + else: + rv = 'Unknown link type: %s' % (hq(link_type)) + def html_escape(): "returns a function stolen from pydoc that can be used to escape HTML" return lambda x: type_wrapper(escape_function, x) ============================================================ --- revision.psp 3f198ce41986db92a1cc0a0373d92a87ddf8b71f +++ revision.psp 77bab654be272a249a635cf03c34f88aed76a042 @@ -7,6 +7,8 @@ import template from template import header,footer from monotone import Monotone +reload(common) +from common import link # # revision.psp @@ -53,7 +55,7 @@ if not cert.has_key("Name") or not cert.has_key("Value"): continue name, value = cert["Name"][0], hq(cert["Value"]) if name == "branch": - value = '' % (urllib.quote(value)) + value + '' + value = link("branch", value) req.write('