MCPcopy Create free account
hub / github.com/ActiveState/code / cmd

Function cmd

recipes/Python/578207_Console_CD_Player/recipe-578207.py:30–45  ·  view source on GitHub ↗
(disc)

Source from the content-addressed store, hash-verified

28 print 'The number is out of range.'
29
30def cmd(disc):
31 disc.init()
32 total = disc.get_numtracks()
33 table = map(disc.get_track_audio, range(total))
34 if sum(table) == 0:
35 print 'This is not an audio CD.'
36 else:
37 index = {}
38 count = 0
39 for i, b in enumerate(table):
40 if b:
41 count += 1
42 index[count] = i
43 cmd_line(disc, index)
44 disc.stop()
45 disc.quit()
46
47def cmd_line(disc, index):
48 while True:

Callers 5

runMethod · 0.85
runMethod · 0.85
mainFunction · 0.85
recipe-498137.pyFile · 0.85
serveFunction · 0.85

Calls 8

mapFunction · 0.85
rangeFunction · 0.85
cmd_lineFunction · 0.85
sumFunction · 0.50
enumerateFunction · 0.50
initMethod · 0.45
stopMethod · 0.45
quitMethod · 0.45

Tested by

no test coverage detected