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
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):
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):
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):
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):
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):
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):
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())