From: Brian Warner Date: Mon, 11 Feb 2008 22:13:18 +0000 (-0700) Subject: webish: display timestamps X-Git-Tag: allmydata-tahoe-0.8.0~99 X-Git-Url: https://git.rkrishnan.org/listings/pb2client.py?a=commitdiff_plain;h=3d72d0082639ec6975bf2c63ee5caa641d25f24b;p=tahoe-lafs%2Ftahoe-lafs.git webish: display timestamps --- diff --git a/src/allmydata/web/directory.xhtml b/src/allmydata/web/directory.xhtml index 99cf926a..e902a217 100644 --- a/src/allmydata/web/directory.xhtml +++ b/src/allmydata/web/directory.xhtml @@ -27,6 +27,7 @@ Filename Type Size + Times other representations @@ -38,6 +39,7 @@ + diff --git a/src/allmydata/webish.py b/src/allmydata/webish.py index b03a511b..7341a3f6 100644 --- a/src/allmydata/webish.py +++ b/src/allmydata/webish.py @@ -205,6 +205,21 @@ class Directory(rend.Page): ctx.fillSlots("overwrite", self.build_overwrite(ctx, (name, target))) ctx.fillSlots("check", check) + times = [] + TIME_FORMAT = "%H:%M:%S %d-%b-%Y" + if "ctime" in metadata: + ctime = time.strftime(TIME_FORMAT, + time.localtime(metadata["ctime"])) + times.append("c: " + ctime) + if "mtime" in metadata: + mtime = time.strftime(TIME_FORMAT, + time.localtime(metadata["mtime"])) + if times: + times.append(T.br()) + times.append("m: " + mtime) + ctx.fillSlots("times", times) + + # build the base of the uri_link link url uri_link = "/uri/" + urllib.quote(target.get_uri())