Changeset 822ed78 in trunk
- Timestamp:
- 2017-07-27T19:26:29Z (8 years ago)
- Branches:
- master
- Children:
- 32110bf
- Parents:
- 0d278e35
- git-author:
- David Stainton <dstainton415@…> (2017-01-11 02:25:42)
- git-committer:
- Jean-Paul Calderone <exarkun@…> (2017-07-27 19:26:29)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/allmydata/web/root.py ¶
r0d278e35 r822ed78 1 1 import time, os 2 import simplejson 2 3 3 4 from twisted.web import http 4 from nevow import rend, url, tags as T5 from nevow import rend, inevow, url, tags as T 5 6 from nevow.inevow import IRequest 6 7 from nevow.static import File as nevow_File # TODO: merge with static.File? … … 183 184 tubid_s = "TubID: "+self.client.get_long_tubid() 184 185 return T.td(title=tubid_s)[self.client.get_long_nodeid()] 186 185 187 def data_my_nickname(self, ctx, data): 186 188 return self.client.nickname 189 190 def renderHTTP(self, ctx): 191 req = inevow.IRequest(ctx) 192 t = get_arg(req, "t") 193 if t == "json": 194 return self.json_welcome(ctx) 195 return rend.Page.renderHTTP(self, ctx) 196 197 def json_welcome(self, ctx): 198 connected_count = self.data_connected_introducers( ctx, None ) 199 inevow.IRequest(ctx).setHeader("content-type", "text/plain") 200 data = { 201 "introducers": { 202 "connected_count": connected_count, 203 }, 204 "servers": {}, 205 } 206 return simplejson.dumps(data, indent=1) + "\n" 187 207 188 208 def render_magic_folder(self, ctx, data):
Note: See TracChangeset
for help on using the changeset viewer.