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

Function main

recipes/Python/578207_Console_CD_Player/recipe-578207.py:3–14  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import pygame.cdrom as face
2
3def main():
4 face.init()
5 count = face.get_count()
6 if count == 0:
7 raw_input('There is no cdrom drive.')
8 elif count == 1:
9 cmd(face.CD(0))
10 else:
11 num = which_CD(count)
12 if num != -1:
13 cmd(face.CD(num))
14 face.quit()
15
16def which_CD(maximum):
17 print 'You have %s cdrom drives.' % maximum

Callers 1

recipe-578207.pyFile · 0.70

Calls 5

cmdFunction · 0.85
which_CDFunction · 0.85
initMethod · 0.45
get_countMethod · 0.45
quitMethod · 0.45

Tested by

no test coverage detected