def adminRestart(handler, now = False): handler.title('Restart') requirePriv(handler, 'Admin') if now: # This is a POST, so we've already blocked other requests and it's safe to restart Event.restart(handler) brick("Restart triggered by %s" % handler.session['user'].username) # This string is checked for in main server().stop() else: print "<img src=\"/static/images/loading.gif\"> Restarting..."