예제 #1
0
파일: wsgi_server.py 프로젝트: zz2/webchat
 def GET(self, request):
     channel = request.GET["channel"]
     begin = request.GET["begin"]
     msg_hander = get_hander(channel)
     msg_json = msg_hander.get(begin)
     rs = Response()
     rs.headers["Content-Type"] = "application/json"
     rs.body = msg_json
     return rs
예제 #2
0
파일: wsgi_server.py 프로젝트: zz2/webchat
 def POST(self, request):
     channel = request.POST["channel"]
     msg = request.POST["msg"]
     channels.add(channel)
     msg_hander = get_hander(channel)
     point_json = msg_hander.post(msg)
     rs = Response()
     rs.headers["Content-Type"] = "application/json"
     rs.body = point_json
     return rs
예제 #3
0
파일: wsgi_server.py 프로젝트: zz2/webchat
 def hup(*args):
     """Shuts down the server, but allows running 
     requests to complete, flush msg_hander
     """
     print "sighup received"
     running = False
     time.sleep(2)
     print channels
     for channel in channels:
         msg_hander = get_hander(channel)
         msg_hander.flash_write_force()
     sys.exit(0)