Пример #1
0
 def handle_request (self, request):
     request['content-type'] = 'text/html; charset=utf-8'
     request.set_deflate()
     request.push (
         '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" '
         '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
         '<html xmlns="http://www.w3.org/1999/xhtml">\r\n'
     )
     request.push ('<head><title>status</title></head><body>\r\n')
     request.push ('<p>Listening on\r\n')
     request.push (repr (request.server.addr))
     request.push ('</p>\r\n')
     request.push ('<table border="1">\r\n')
     all_threads = ((x, coro.where(x)) for x in coro.all_threads.values())
     for thread, traceback in all_threads:
         request.push ('<tr><td>%s\r\n' % self.clean (repr(thread)))
         request.push ('<pre>\r\n')
         # traceback format seems to have changed
         for level in traceback[1:-1].split ('] ['):
             [file, fun] = level.split (' ')
             fun, line = fun.split ('|')
             request.push ('<b>%20s</b>:%3d %s\r\n' % (self.clean (fun), int(line), self.clean (file)))
         request.push ('</pre></td></tr>')
     request.push ('</table>\r\n')
     request.push ('<p><a href="status">Update</a></p>')
     request.push ('</body></html>')
     request.done()
Пример #2
0
 def handle_request (self, request):
     request['Content-Type'] = 'text/html'
     request.push ('<p>Listening on\r\n')
     request.push ( repr(request._server.addr) )
     request.push ('</p>\r\n')
     request.push ('<p>Request dump</p><PRE>\r\n')
     request.push ( pprint.pformat(request) )
     request.push ('</PRE>\r\n')
     request.push ('<ul>\r\n')
     all_threads = map(lambda x: (x[1], coro.where(x[1])), coro.all_threads.items())
     for thread, traceback in all_threads:
         request.push ('<li>%s\r\n' % self.clean (repr(thread)))
         request.push ('<pre>\r\n')
         for level in traceback[1:-1].split ('|'):
             [file, fun, line] = level.split(':')
             request.push ('<b>%20s</b>:%03d %s\r\n' % (fun,int(line),file))
         request.push ('</pre>')
     request.push ('</ul>\r\n')
     request.done()
Пример #3
0
 def handle_request(self, request):
     request['Content-Type'] = 'text/html'
     request.push('<p>Listening on\r\n')
     request.push(repr(request._server.addr))
     request.push('</p>\r\n')
     request.push('<p>Request dump</p><PRE>\r\n')
     request.push(pprint.pformat(request))
     request.push('</PRE>\r\n')
     request.push('<ul>\r\n')
     all_threads = map(lambda x: (x[1], coro.where(x[1])),
                       coro.all_threads.items())
     for thread, traceback in all_threads:
         request.push('<li>%s\r\n' % self.clean(repr(thread)))
         request.push('<pre>\r\n')
         for level in traceback[1:-1].split('|'):
             [file, fun, line] = level.split(':')
             request.push('<b>%20s</b>:%03d %s\r\n' %
                          (fun, int(line), file))
         request.push('</pre>')
     request.push('</ul>\r\n')
     request.done()