X-Git-Url: https://git.rkrishnan.org/?a=blobdiff_plain;f=src%2Fallmydata%2Fweb%2Fstatus.py;fp=src%2Fallmydata%2Fweb%2Fstatus.py;h=7ab3efe27f6cc04b2830b45f6c7f335078c2578f;hb=6226f6b497028889859dfcff56d4dbd7b65b8c2c;hp=b363f857c50e04327b1345d24406bd7af685d8ca;hpb=6d4a8bcd7f4af289e95195a2090c95b79a43ef59;p=tahoe-lafs%2Ftahoe-lafs.git diff --git a/src/allmydata/web/status.py b/src/allmydata/web/status.py index b363f857..7ab3efe2 100644 --- a/src/allmydata/web/status.py +++ b/src/allmydata/web/status.py @@ -5,7 +5,7 @@ from twisted.internet import defer from nevow import rend, inevow, tags as T from allmydata.util import base32, idlib from allmydata.web.common import getxmlfile, get_arg, \ - abbreviate_time, abbreviate_rate, abbreviate_size, plural, compute_rate + abbreviate_time, abbreviate_rate, abbreviate_size, plural, compute_rate, render_time from allmydata.interfaces import IUploadStatus, IDownloadStatus, \ IPublishStatus, IRetrieveStatus, IServermapUpdaterStatus @@ -162,9 +162,7 @@ class UploadStatusPage(UploadResultsRendererMixin, rend.Page): return d def render_started(self, ctx, data): - TIME_FORMAT = "%H:%M:%S %d-%b-%Y" - started_s = time.strftime(TIME_FORMAT, - time.localtime(data.get_started())) + started_s = render_time(data.get_started()) return started_s def render_si(self, ctx, data): @@ -614,9 +612,7 @@ class DownloadStatusPage(DownloadResultsRendererMixin, rend.Page): return d def render_started(self, ctx, data): - TIME_FORMAT = "%H:%M:%S %d-%b-%Y" - started_s = time.strftime(TIME_FORMAT, - time.localtime(data.get_started())) + started_s = render_time(data.get_started()) return started_s + " (%s)" % data.get_started() def render_si(self, ctx, data): @@ -647,9 +643,7 @@ class DownloadStatusTimelinePage(rend.Page): docFactory = getxmlfile("download-status-timeline.xhtml") def render_started(self, ctx, data): - TIME_FORMAT = "%H:%M:%S %d-%b-%Y" - started_s = time.strftime(TIME_FORMAT, - time.localtime(data.get_started())) + started_s = render_time(data.get_started()) return started_s + " (%s)" % data.get_started() def render_si(self, ctx, data): @@ -684,9 +678,7 @@ class RetrieveStatusPage(rend.Page, RateAndTimeMixin): self.retrieve_status = data def render_started(self, ctx, data): - TIME_FORMAT = "%H:%M:%S %d-%b-%Y" - started_s = time.strftime(TIME_FORMAT, - time.localtime(data.get_started())) + started_s = render_time(data.get_started()) return started_s def render_si(self, ctx, data): @@ -772,9 +764,7 @@ class PublishStatusPage(rend.Page, RateAndTimeMixin): self.publish_status = data def render_started(self, ctx, data): - TIME_FORMAT = "%H:%M:%S %d-%b-%Y" - started_s = time.strftime(TIME_FORMAT, - time.localtime(data.get_started())) + started_s = render_time(data.get_started()) return started_s def render_si(self, ctx, data): @@ -883,18 +873,14 @@ class MapupdateStatusPage(rend.Page, RateAndTimeMixin): self.update_status = data def render_started(self, ctx, data): - TIME_FORMAT = "%H:%M:%S %d-%b-%Y" - started_s = time.strftime(TIME_FORMAT, - time.localtime(data.get_started())) + started_s = render_time(data.get_started()) return started_s def render_finished(self, ctx, data): when = data.get_finished() if not when: return "not yet" - TIME_FORMAT = "%H:%M:%S %d-%b-%Y" - started_s = time.strftime(TIME_FORMAT, - time.localtime(data.get_finished())) + started_s = render_time(data.get_finished()) return started_s def render_si(self, ctx, data): @@ -1110,9 +1096,7 @@ class Status(rend.Page): def render_row(self, ctx, data): s = data - TIME_FORMAT = "%H:%M:%S %d-%b-%Y" - started_s = time.strftime(TIME_FORMAT, - time.localtime(s.get_started())) + started_s = render_time(s.get_started()) ctx.fillSlots("started", started_s) si_s = base32.b2a_or_none(s.get_storage_index())