def _got_helper(self, helper):
self._helper = helper
+ def get_helper_info(self):
+ # return a tuple of (helper_furl_or_None, connected_bool)
+ return (self._helper_furl, bool(self._helper))
+
def upload(self, uploadable):
# this returns the URI
assert self.parent
<div>My nodeid: <span n:render="string" n:data="my_nodeid" /></div>
<div>My version: <span n:render="string" n:data="version" /></div>
+
<div>Introducer: <span n:render="string" n:data="introducer_furl" /></div>
<div>Connected to introducer?: <span n:render="string" n:data="connected_to_introducer" /></div>
+
+<div>Helper: <span n:render="string" n:data="helper_furl" /></div>
+<div>Connected to helper?: <span n:render="string" n:data="connected_to_helper" /></div>
+
<div>Known+Connected Peers: <span n:render="string" n:data="num_peers" /></div>
<div>
if IClient(ctx).connected_to_introducer():
return "yes"
return "no"
+
+ def data_helper_furl(self, ctx, data):
+ uploader = IClient(ctx).getServiceNamed("uploader")
+ furl, connected = uploader.get_helper_info()
+ return furl
+ def data_connected_to_helper(self, ctx, data):
+ uploader = IClient(ctx).getServiceNamed("uploader")
+ furl, connected = uploader.get_helper_info()
+ if connected:
+ return "yes"
+ return "no"
+
def data_num_peers(self, ctx, data):
#client = inevow.ISite(ctx)._client
client = IClient(ctx)