diff options
author | Diego Roversi <diegor@tiscali.it> | 2019-09-12 21:33:58 +0200 |
---|---|---|
committer | Diego Roversi <diegor@tiscali.it> | 2019-09-12 21:33:58 +0200 |
commit | f2779197b13fdbbd0d42e48215c51d24d86ee91b (patch) | |
tree | 968267aa9909470c27b43109029e87d1f126b4e7 /display/snd_linux.py | |
parent | bc2155a93cd15c975881d7ca8f57f0f4b5c4aa27 (diff) |
2to3 of display module
Diffstat (limited to 'display/snd_linux.py')
-rw-r--r-- | display/snd_linux.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/display/snd_linux.py b/display/snd_linux.py index dae82e0..fd82619 100644 --- a/display/snd_linux.py +++ b/display/snd_linux.py @@ -1,7 +1,7 @@ import sys -from cStringIO import StringIO -import puremixer -from music1 import Music +from io import StringIO +from . import puremixer +from .music1 import Music class Sound: @@ -30,10 +30,10 @@ class Sound: if name == self.format: break else: - print >> sys.stderr, 'available sound formats:' + print('available sound formats:', file=sys.stderr) for name, bits, signed, byteorder in self.Formats: - print >> sys.stderr, ' %-8s %s' % (name, nicefmttext( - bits, signed, byteorder)) + print(' %-8s %s' % (name, nicefmttext( + bits, signed, byteorder)), file=sys.stderr) sys.exit(2) import linuxaudiodev @@ -41,9 +41,9 @@ class Sound: f = linuxaudiodev.open('w') f.setparameters(self.freq, p['bits'], 1, getattr(linuxaudiodev, 'AFMT_' + self.format)) - except Exception, e: - print >> sys.stderr, "sound disabled: %s: %s" % ( - e.__class__.__name__, e) + except Exception as e: + print("sound disabled: %s: %s" % ( + e.__class__.__name__, e), file=sys.stderr) return self.f = f self.mixer = mixer = puremixer.PureMixer(**p) @@ -136,7 +136,7 @@ def nicefmttext(bits, signed, byteorder): return s def htmloptionstext(nameval): - import modes + from . import modes l = ['<font size=-1>Sampling <%s>' % nameval('select', 'fmt')] for name, bits, signed, byteorder in Sound.Formats: l.append('<'+nameval('option', 'fmt', name, default='S16_NE')+'>'+ |