summaryrefslogtreecommitdiff
path: root/common/javaserver.py
diff options
context:
space:
mode:
authorDiego Roversi <diegor@tiscali.it>2019-09-08 22:05:57 +0200
committerDiego Roversi <diegor@tiscali.it>2019-09-08 22:05:57 +0200
commitc23b138ed72d794521b19ff7d8076b32b0b7bf46 (patch)
treec8e82a4ca4da05ba1ad28d4ff64a157bc1eb7952 /common/javaserver.py
parent1d9925c287b318ec21343e2682b51ab6a36ae8db (diff)
2to3
Diffstat (limited to 'common/javaserver.py')
-rw-r--r--common/javaserver.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/javaserver.py b/common/javaserver.py
index 15a586b..50bd7f0 100644
--- a/common/javaserver.py
+++ b/common/javaserver.py
@@ -1,5 +1,5 @@
import sys, os
-from cStringIO import StringIO
+from io import StringIO
import httpserver
PLAYERNAMES = ['Bub', 'Bob', 'Boob', 'Beb',
@@ -68,11 +68,11 @@ def indexloader(**options):
if 'cheat' in options:
for opt in options.pop('cheat'):
__cheat(opt)
- import gamesrv
+ from . import gamesrv
if gamesrv.game is None:
indexdata = EMPTY_PAGE
else:
- names = playernames(options).items()
+ names = list(playernames(options).items())
indexdata = INDEX_PAGE % {
'title': gamesrv.game.FnDesc,
'width': gamesrv.game.width,
@@ -114,16 +114,16 @@ def wav2au(data):
return data
def sampleloader(code=[], **options):
- import gamesrv
+ from . import gamesrv
try:
data = wave_cache[code[0]]
except KeyError:
- for key, snd in gamesrv.samples.items():
+ for key, snd in list(gamesrv.samples.items()):
if str(getattr(snd, 'code', '')) == code[0]:
data = wave_cache[code[0]] = wav2au(snd.read())
break
else:
- raise KeyError, code[0]
+ raise KeyError(code[0])
return StringIO(data), 'audio/wav'