From 60bddba8275dcc8489cb8e2b39bcb2b05deed6ff Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Thu, 29 Mar 2007 14:31:55 -0700 Subject: [PATCH] webish: add 'my nodeid' to the page --- src/allmydata/test/test_system.py | 7 ++++++- src/allmydata/web/welcome.xhtml | 1 + src/allmydata/webish.py | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/allmydata/test/test_system.py b/src/allmydata/test/test_system.py index 346b34de..67df5489 100644 --- a/src/allmydata/test/test_system.py +++ b/src/allmydata/test/test_system.py @@ -1,9 +1,10 @@ +import os from twisted.trial import unittest from twisted.internet import defer, reactor from twisted.application import service from allmydata import client, queen -import os +from allmydata.util import idlib from foolscap.eventual import flushEventualQueue from twisted.python import log from twisted.web.client import getPage @@ -171,6 +172,10 @@ class SystemTest(unittest.TestCase): "I didn't see the right 'connected peers' message " "in: %s" % page ) + expected = "My nodeid: %s" % idlib.b2a(self.clients[0].nodeid) + self.failUnless(expected in page, + "I didn't see the right 'My nodeid' message " + "in: %s" % page) d.addCallback(_got_welcome) d.addCallback(lambda res: getPage(base + "vdrive/subdir1")) def _got_subdir1(page): diff --git a/src/allmydata/web/welcome.xhtml b/src/allmydata/web/welcome.xhtml index 11006bf6..d15260aa 100644 --- a/src/allmydata/web/welcome.xhtml +++ b/src/allmydata/web/welcome.xhtml @@ -14,6 +14,7 @@

Mesh Status

+
My nodeid:
Queen:
Connected to queen?:
Known+Connected Peers:
diff --git a/src/allmydata/webish.py b/src/allmydata/webish.py index f3f38de4..62a272b6 100644 --- a/src/allmydata/webish.py +++ b/src/allmydata/webish.py @@ -27,6 +27,8 @@ class Welcome(rend.Page): addSlash = True docFactory = getxmlfile("welcome.xhtml") + def data_my_nodeid(self, ctx, data): + return idlib.b2a(IClient(ctx).nodeid) def data_queen_pburl(self, ctx, data): return IClient(ctx).introducer_furl def data_connected_to_queen(self, ctx, data): -- 2.45.2