def send_json() : global startTime return jsonify( {'StartTime' : startTime, 'Hostname': utils.gethostname(), 'LocalAddress': utils.getlocaladdress(), 'RemoteAddress': request.remote_addr, 'Server Hit': str(hit.getServerHitCount())} )
def show_details(): global startTime return "<html>" + \ "<head><title>Docker + Flask Demo</title></head>" + \ "<body>" + \ "<table>" + \ "<tr><td> Start Time </td> <td>" + startTime + "</td> </tr>" \ "<tr><td> Hostname </td> <td>" + utils.gethostname() + "</td> </tr>" \ "<tr><td> Local Address </td> <td>" + utils.getlocaladdress() + "</td> </tr>" \ "<tr><td> Remote Address </td> <td>" + request.remote_addr + "</td> </tr>" \ "<tr><td> Server Hit </td> <td>" + str(hit.getServerHitCount()) + "</td> </tr>" \ "</table>" + \ "</body>" + \ "</html>"
def show_details(): global startTime #delay = 9999999 ** 99999 return "<html>" + \ "<head><title>Docker + Flask Demo</title></head>" + \ "<body style='background-color:blue'>" + \ "<table>" + \ "<tr><td> Start Time </td> <td>" + startTime + "</td> </tr>" \ "<tr><td> HostName/ContainerName </td> <td>" + utils.gethostname() + "</td> </tr>" \ "<tr><td> Local Address </td> <td>" + utils.getlocaladdress() + "</td> </tr>" \ "<tr><td> Remote Address </td> <td>" + request.remote_addr + "</td> </tr>" \ "<tr><td> Server Hit </td> <td>" + str(hit.getServerHitCount()) + "</td> </tr>" \ "</table>" + \ "</body>" + \ "</html>"
def show_details(): global startTime return "<html>" + \ "<head><title>Docker + Flask Demo</title></head>" + \ "<body>" + \ "<table>" + \ "<tr><td> Start Time </td> <td>" + startTime + "</td> </tr>" \ "<tr><td> Hostname </td> <td>" + utils.gethostname() + "</td> </tr>" \ "<tr><td> Local Address </td> <td>" + utils.getlocaladdress() + "</td> </tr>" \ "<tr><td> Remote Address </td> <td>" + request.remote_addr + "</td> </tr>" \ "<tr><td> Server Hit </td> <td>" + str(hit.getServerHitCount()) + "</td> </tr>" \ "<tr><td> JSON </td> <td> <a href='/json'>JSON</a> </td> </tr>" \ "<tr><td> Joystick controller </td> <td> <a href='/joystick'>Joystick</a> </td> </tr>" \ "<tr><td> Go Function </td> <td> <a href='/go'>Go</a> </td> </tr>" \ "<tr><td> Comander controller</td> <td> <a href='/comander'>Comander</a> </td> </tr>" \ "<tr><td> Move Function </td> <td> <a href='/move'>Move</a> </td> </tr>" \ "</table>" + \ "</body>" + \ "</html>"
def send_json() : global startTime return jsonify( {'StartTime' : startTime, 'Server Hit': str(hit.getServerHitCount())} )
def test_getServerHitCount(self): self.assertEqual(hit.getServerHitCount(), 1) self.assertEqual(hit.getServerHitCount(), 2)