Skip to content

Commit

Permalink
In Python 3 print is a function
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeLametta committed May 8, 2018
1 parent 37fd1c6 commit 44ece38
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 36 deletions.
8 changes: 4 additions & 4 deletions whipper/command/cd.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def doCommand(self):
sys.stdout.write("output directory %s already exists\n" %
dirname.encode('utf-8'))
else:
print("creating output directory %s" % dirname.encode('utf-8'))
print(("creating output directory %s" % dirname.encode('utf-8')))
os.makedirs(dirname)

# FIXME: turn this into a method
Expand Down Expand Up @@ -460,14 +460,14 @@ def _ripIfNotRipped(number):
htoa = self.program.getHTOA()
if htoa:
start, stop = htoa
print('found Hidden Track One Audio from frame %d to %d' % (
start, stop))
print(('found Hidden Track One Audio from frame %d to %d' % (
start, stop)))
_ripIfNotRipped(0)

for i, track in enumerate(self.itable.tracks):
# FIXME: rip data tracks differently
if not track.audio:
print('skipping data track %d, not implemented' % (i + 1))
print(('skipping data track %d, not implemented' % (i + 1)))
# FIXME: make it work for now
track.indexes[1].relative = 0
continue
Expand Down
8 changes: 4 additions & 4 deletions whipper/command/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def do(self):
prompt=self.options.prompt)

if not prog.metadata:
print 'Not in MusicBrainz database, skipping'
print('Not in MusicBrainz database, skipping')
continue

prog.metadata.discid = mbdiscid
Expand All @@ -98,10 +98,10 @@ def do(self):
runner.run(t)
path = os.path.basename(path)
if t.changed:
print 'Retagged %s' % path
print('Retagged %s' % path)
else:
print '%s already tagged correctly' % path
print
print('%s already tagged correctly' % path)
print()


class Verify(BaseCommand):
Expand Down
2 changes: 1 addition & 1 deletion whipper/command/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,5 @@ def handle_arguments(self):
self.parser.print_help()
sys.exit(0)
if self.options.version:
print "whipper %s" % whipper.__version__
print("whipper %s" % whipper.__version__)
sys.exit(0)
24 changes: 12 additions & 12 deletions whipper/command/mblookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,26 @@ def do(self):
try:
discId = unicode(self.options.mbdiscid)
except IndexError:
print 'Please specify a MusicBrainz disc id.'
print('Please specify a MusicBrainz disc id.')
return 3

metadatas = musicbrainz(discId)

print '%d releases' % len(metadatas)
print('%d releases' % len(metadatas))
for i, md in enumerate(metadatas):
print '- Release %d:' % (i + 1, )
print ' Artist: %s' % md.artist.encode('utf-8')
print ' Title: %s' % md.title.encode('utf-8')
print ' Type: %s' % md.releaseType.encode('utf-8') # noqa: E501
print ' URL: %s' % md.url
print ' Tracks: %d' % len(md.tracks)
print('- Release %d:' % (i + 1, ))
print(' Artist: %s' % md.artist.encode('utf-8'))
print(' Title: %s' % md.title.encode('utf-8'))
print(' Type: %s' % md.releaseType.encode('utf-8')) # noqa: E501
print(' URL: %s' % md.url)
print(' Tracks: %d' % len(md.tracks))
if md.catalogNumber:
print ' Cat no: %s' % md.catalogNumber
print(' Cat no: %s' % md.catalogNumber)
if md.barcode:
print ' Barcode: %s' % md.barcode
print(' Barcode: %s' % md.barcode)

for j, track in enumerate(md.tracks):
print ' Track %2d: %s - %s' % (
print(' Track %2d: %s - %s' % (
j + 1, track.artist.encode('utf-8'),
track.title.encode('utf-8')
)
))
6 changes: 3 additions & 3 deletions whipper/common/accurip.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ def print_report(result):
logger.error(
'no track AR CRC on non-HTOA track %d' % track.number
)
print('track %2d: unknown (error)' % track.number)
print(('track %2d: unknown (error)' % track.number))
else:
print('track %2d: %-16s %-23s v1 [%s], v2 [%s], DB [%s]' % (
print(('track %2d: %-16s %-23s v1 [%s], v2 [%s], DB [%s]' % (
track.number, status, conf,
track.AR['v1']['CRC'], track.AR['v2']['CRC'], db
))
)))
2 changes: 1 addition & 1 deletion whipper/common/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def getTagList(self, number):
mbidTrack = track.mbid
mbidTrackArtist = track.mbidArtist
except IndexError, e:
print 'ERROR: no track %d found, %r' % (number, e)
print('ERROR: no track %d found, %r' % (number, e))
raise
else:
# htoa defaults to disc's artist
Expand Down
6 changes: 3 additions & 3 deletions whipper/extern/asyncsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ def send_all(p, data):
shell, commands, tail = ('sh', ('ls', 'echo HELLO WORLD'), '\n')

a = Popen(shell, stdin=PIPE, stdout=PIPE)
print recv_some(a),
print(recv_some(a))
for cmd in commands:
send_all(a, cmd + tail)
print recv_some(a),
print(recv_some(a))
send_all(a, 'exit' + tail)
print recv_some(a, e=0)
print(recv_some(a, e=0))
a.wait()
4 changes: 2 additions & 2 deletions whipper/extern/task/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def stop(self):
self.debug('stopping')
self.running = False
if not self.runner:
print 'ERROR: stopping task which is already stopped'
print('ERROR: stopping task which is already stopped')
import traceback
traceback.print_stack()
self.runner = None
Expand Down Expand Up @@ -214,7 +214,7 @@ def setException(self, exception):

def schedule(self, delta, callable, *args, **kwargs):
if not self.runner:
print "ERROR: scheduling on a task that's altready stopped"
print("ERROR: scheduling on a task that's altready stopped")
import traceback
traceback.print_stack()
return
Expand Down
2 changes: 1 addition & 1 deletion whipper/image/cue.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def parse(self):
if m:
if not currentTrack:
self.message(number, 'INDEX without preceding TRACK')
print 'ouch'
print('ouch')
continue

indexNumber = int(m.expand('\\1'))
Expand Down
4 changes: 2 additions & 2 deletions whipper/image/toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def parse(self):
if m:
if not currentTrack:
self.message(number, 'START without preceding TRACK')
print 'ouch'
print('ouch')
continue

length = common.msfToFrames(m.group('length'))
Expand All @@ -362,7 +362,7 @@ def parse(self):
if m:
if not currentTrack:
self.message(number, 'INDEX without preceding TRACK')
print 'ouch'
print('ouch')
continue

indexNumber += 1
Expand Down
4 changes: 2 additions & 2 deletions whipper/program/cdparanoia.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def _done(self):

if not self.exception and self._popen.returncode != 0:
if self._errors:
print "\n".join(self._errors)
print("\n".join(self._errors))
else:
logger.warning('exit code %r', self._popen.returncode)
self.exception = ReturnCodeError(self._popen.returncode)
Expand Down Expand Up @@ -549,7 +549,7 @@ def stop(self):
else:
logger.debug('stop: exception %r', self.exception)
except Exception, e:
print 'WARNING: unhandled exception %r' % (e, )
print('WARNING: unhandled exception %r' % (e, ))

task.MultiSeparateTask.stop(self)

Expand Down
2 changes: 1 addition & 1 deletion whipper/program/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ def unmount_device(device):
logger.debug('possibly unmount real path %r' % device)
proc = open('/proc/mounts').read()
if device in proc:
print 'Device %s is mounted, unmounting' % device
print('Device %s is mounted, unmounting' % device)
os.system('umount %s' % device)

0 comments on commit 44ece38

Please sign in to comment.