summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Roversi <diegor@tiscali.it>2019-09-08 22:50:51 +0200
committerDiego Roversi <diegor@tiscali.it>2019-09-08 22:50:51 +0200
commite5341ab3ebadeff4608dcc270912b885b7fadcd0 (patch)
tree4d9379a99279418b4ddf059507aa98a4f1034c75
parentbba12dc9f02c5c408380d0789d2c85c824a56be8 (diff)
fix python syntax inside html page
-rw-r--r--http2/data/index.html62
1 files changed, 30 insertions, 32 deletions
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 ''
<td width=48><img src="%(juststarted and 'sfbob.png' or 'bob.png')s"></td>
<td>%(
if running:
- print '<form name="S" action="index.html" method="get">'
- print '<input type=hidden name="time" value="%s">' % tim
- print '<table width="100%" border=0><tr><td><p><strong>'
+ print( '<form name="S" action="index.html" method="get">')
+ print( '<input type=hidden name="time" value="%s">' % tim)
+ print( '<table width="100%" border=0><tr><td><p><strong>')
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 '</strong></p></td>'
- print '<td align="center"><input type=submit value="Update on connected clients"></td>'
- print '</tr></table></form>'
- print '<p><strong><a href="join.html?host=%s&port=%s&httpport=%s&time=%s">' % (running[0][0], running[0][1], self.httpport, tim),
- print 'Join your own game now</a></strong> at <strong>%s:%s</strong></p>' % (
- running[0])
+ print( '%d connected clients.' % count)
+ print( '</strong></p></td>')
+ print( '<td align="center"><input type=submit value="Update on connected clients"></td>')
+ print( '</tr></table></form>')
+ print( '<p><strong><a href="join.html?host=%s&port=%s&httpport=%s&time=%s">' % (running[0][0], running[0][1], self.httpport, tim),)
+ print( 'Join your own game now</a></strong> at <strong>%s:%s</strong></p>' % running[0])
##if metapublish:
## import time
## print '<p><a href="register.html?a=%s">' % time.time()
@@ -121,13 +120,13 @@ if running:
<input type=hidden name="time" value="%(tim)s">
%(
if self.Game:
- print '<input type=submit',
+ print( '<input type=submit', )
if running:
- print 'value="Start another game">'
+ print( 'value="Start another game">')
else:
- print 'value="Start a new game">'
+ print( 'value="Start a new game">')
else:
- print 'You need the <a href="http://bub-n-bros.sourceforge.net/download.html">complete version</a> to start a new game.<br><font size=-1>With this version you can only connect to existing servers and <font color="#FF0000">only over fast links!</font></font>'
+ print( 'You need the <a href="http://bub-n-bros.sourceforge.net/download.html">complete version</a> to start a new game.<br><font size=-1>With this version you can only connect to existing servers and <font color="#FF0000">only over fast links!</font></font>')
)s
</form>
</td>
@@ -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 '<a href="join.html?host=%s&port=%d&httpport=%s&time=%s">' % (
- addr[0], addr[1], httpport, tim)
+ print( '<a href="join.html?host=%s&port=%d&httpport=%s&time=%s">' % (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 '<strong>%s:%s</strong></a> playing <strong>%s</strong>' % (
- host, port, infolst[0])
+ print( '<strong>%s:%s</strong></a> playing <strong>%s</strong>' % (host, port, infolst[0]) )
if len(infolst) > 1:
- print '&nbsp;(%s)' % ' &middot; &middot; '.join(infolst[1:])
+ print( '&nbsp;(%s)' % ' &middot; &middot; '.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 '</td></tr>'
+ print( "(no server found)")
+ print( '</td></tr>')
for s in servers[1:]:
- print '<tr><td bgcolor="#FFC0C0">'
+ print( '<tr><td bgcolor="#FFC0C0">')
show(s)
- print '</td></tr>'
- print '<tr><td bgcolor="#FFC0C0">'
+ print( '</td></tr>')
+ print( '<tr><td bgcolor="#FFC0C0">')
)s
<table border=0><tr>
<td width=48><img src="boob.png"></td>
@@ -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 '<p><font size=-1>Note: your server does not appear in this list'
- print 'because the UDP port %d is already in use (is another Bub &amp; Bob server running on this machine?).' % hostchooser.UDP_PORT
- print 'Use the full server address <strong>%s:%s</strong></font></p>' % running[0]
+ print( '<p><font size=-1>Note: your server does not appear in this list')
+ print( 'because the UDP port %d is already in use (is another Bub &amp; Bob server running on this machine?).' % hostchooser.UDP_PORT)
+ print( 'Use the full server address <strong>%s:%s</strong></font></p>' % running[0])
)s
<form name="L" action="index.html" method="get">
<input type=hidden name="time" value="%(tim)s">