self.failUnlessIn('<a href="status">Recent and Active Operations</a>', res)
self.failUnlessIn('<a href="statistics">Operational Statistics</a>', res)
self.failUnlessIn('<input type="hidden" name="t" value="report-incident" />', res)
+ self.failUnlessIn('Page rendered at', res)
+ self.failUnlessIn('Tahoe-LAFS code imported from:', res)
res_u = res.decode('utf-8')
self.failUnlessIn(u'<td>fake_nickname \u263A</td>', res_u)
self.failUnlessIn(u'<div class="nickname">other_nickname \u263B</div>', res_u)
def _check(res):
self.failUnlessIn('Welcome to the Tahoe-LAFS Introducer', res)
self.failUnlessIn(FAVICON_MARKUP, res)
+ self.failUnlessIn('Page rendered at', res)
+ self.failUnlessIn('Tahoe-LAFS code imported from:', res)
d.addCallback(_check)
return d
from allmydata.util.encodingutil import to_str, quote_output
+TIME_FORMAT = "%H:%M:%S %d-%b-%Y"
+
+
class IOpHandleTable(Interface):
pass
</table>
</div>
+<p class="minutia">Page rendered at <span n:render="data" n:data="rendered_at" /></p>
+
</body>
</html>
import simplejson
from allmydata import get_package_versions_string
from allmydata.util import idlib
-from allmydata.web.common import getxmlfile, get_arg
+from allmydata.web.common import getxmlfile, get_arg, TIME_FORMAT
+
class IntroducerRoot(rend.Page):
return simplejson.dumps(res, indent=1) + "\n"
# FIXME: This code is duplicated in root.py and introweb.py.
+ def data_rendered_at(self, ctx, data):
+ return time.strftime(TIME_FORMAT, time.localtime())
def data_version(self, ctx, data):
return get_package_versions_string()
def data_import_path(self, ctx, data):
from allmydata.web import filenode, directory, unlinked, status, operations
from allmydata.web import storage
from allmydata.web.common import abbreviate_size, getxmlfile, WebError, \
- get_arg, RenderMixin, get_format, get_mutable_type
+ get_arg, RenderMixin, get_format, get_mutable_type, TIME_FORMAT
class URIHandler(RenderMixin, rend.Page):
#child_server # let's reserve this for storage-server-over-HTTP
# FIXME: This code is duplicated in root.py and introweb.py.
+ def data_rendered_at(self, ctx, data):
+ return time.strftime(TIME_FORMAT, time.localtime())
def data_version(self, ctx, data):
return get_package_versions_string()
def data_import_path(self, ctx, data):
version = announcement["my-version"]
service_name = announcement["service-name"]
- TIME_FORMAT = "%H:%M:%S %d-%b-%Y"
ctx.fillSlots("address", addr)
ctx.fillSlots("connected", connected)
ctx.fillSlots("connected-bool", bool(rhost))
<footer>
<p>© <a href="https://tahoe-lafs.org/">Tahoe-LAFS Software Foundation 2013</a></p>
+ <p class="minutia">Page rendered at <span n:render="data" n:data="rendered_at" /></p>
<p class="minutia" n:render="string" n:data="version"></p>
<p class="minutia">Tahoe-LAFS code imported from: <span n:render="data" n:data="import_path" /></p>
</footer>