From f2779197b13fdbbd0d42e48215c51d24d86ee91b Mon Sep 17 00:00:00 2001 From: Diego Roversi Date: Thu, 12 Sep 2019 21:33:58 +0200 Subject: 2to3 of display module --- display/snd_linux.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'display/snd_linux.py') 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 = ['Sampling <%s>' % nameval('select', 'fmt')] for name, bits, signed, byteorder in Sound.Formats: l.append('<'+nameval('option', 'fmt', name, default='S16_NE')+'>'+ -- cgit v1.2.3