From e5341ab3ebadeff4608dcc270912b885b7fadcd0 Mon Sep 17 00:00:00 2001 From: Diego Roversi Date: Sun, 8 Sep 2019 22:50:51 +0200 Subject: fix python syntax inside html page --- http2/data/index.html | 62 +++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 32 deletions(-) (limited to 'http2/data') diff --git a/http2/data/index.html b/http2/data/index.html index 08dcc2f..6007854 100644 --- a/http2/data/index.html +++ b/http2/data/index.html @@ -78,25 +78,24 @@ externaltarget = running and ' target="new"' or '' %( if running: - print '
' - print '' % tim - print '') + print( '') + print( '

' + print( '') + print( '' % tim) + print( '' - print '' - print '

') if juststarted: - print 'Server started!' + print( 'Server started!') elif justconnected: - print 'Playing' + print( 'Playing') elif count == 0: - print 'No client is connected to your server at the moment.' + print( 'No client is connected to your server at the moment.') elif count == 1: - print 'One connected client.' + print( 'One connected client.') else: - print '%d connected clients.' % count - print '

' - print '

' % (running[0][0], running[0][1], self.httpport, tim), - print 'Join your own game now at %s:%s

' % ( - running[0]) + print( '%d connected clients.' % count) + print( '

') + print( '

' % (running[0][0], running[0][1], self.httpport, tim),) + print( 'Join your own game now at %s:%s

' % running[0]) ##if metapublish: ## import time ## print '

' % time.time() @@ -121,13 +120,13 @@ if running: %( if self.Game: - print '' + print( 'value="Start another game">') else: - print 'value="Start a new game">' + print( 'value="Start a new game">') else: - print 'You need the complete version to start a new game.
With this version you can only connect to existing servers and only over fast links!' + print( 'You need the complete version to start a new game.
With this version you can only connect to existing servers and only over fast links!') )s @@ -160,15 +159,15 @@ else: servers = self.getlocalservers()[:] found = [] -def show((addr, (info, ping)), found=found): +def show(param, found=found): + (addr, (info, ping)) = param import socket infolst = info.split(':') or ['?'] if len(infolst) >= 3: httpport = infolst.pop(2) else: httpport = 'off' - print '' % ( - addr[0], addr[1], httpport, tim) + print( '' % (addr[0], addr[1], httpport, tim) ) host, port = addr #host = socket.gethostbyaddr(host)[0] if ping is not None: @@ -177,10 +176,9 @@ def show((addr, (info, ping)), found=found): infolst.append('this is your own server') found.append(1) infolst = map(htmlquote, infolst) - print '%s:%s playing %s' % ( - host, port, infolst[0]) + print( '%s:%s playing %s' % (host, port, infolst[0]) ) if len(infolst) > 1: - print ' (%s)' % ' · · '.join(infolst[1:]) + print( ' (%s)' % ' · · '.join(infolst[1:]) ) if servers is None: rowspan = 1 @@ -199,13 +197,13 @@ if servers is not None: if servers: show(servers[0]) else: - print "(no server found)" - print '' + print( "(no server found)") + print( '') for s in servers[1:]: - print '' + print( '') show(s) - print '' - print '' + print( '') + print( '') )s @@ -214,9 +212,9 @@ if servers is not None: if running and not found: import hostchooser, gamesrv if gamesrv.displaysockport(gamesrv.openpingsocket()) != hostchooser.UDP_PORT: - print '

Note: your server does not appear in this list' - print 'because the UDP port %d is already in use (is another Bub & Bob server running on this machine?).' % hostchooser.UDP_PORT - print 'Use the full server address %s:%s

' % running[0] + print( '

Note: your server does not appear in this list') + print( 'because the UDP port %d is already in use (is another Bub & Bob server running on this machine?).' % hostchooser.UDP_PORT) + print( 'Use the full server address %s:%s

' % running[0]) )s -- cgit v1.2.3