mirror of
https://github.com/python/cpython.git
synced 2025-09-15 13:16:12 +00:00
If the module SUNAUDIODEV was generated on an older version of
Solaris, the `CD' macro won't exist in the header file, so this will raise a NameError.
This commit is contained in:
parent
9ade9ddb14
commit
d55049aede
1 changed files with 25 additions and 16 deletions
|
@ -95,7 +95,9 @@ class MainWindow:
|
||||||
if not info.i_avail_ports & LINE_IN:
|
if not info.i_avail_ports & LINE_IN:
|
||||||
btn.configure(state=DISABLED)
|
btn.configure(state=DISABLED)
|
||||||
buttons.append(btn)
|
buttons.append(btn)
|
||||||
##
|
## if SUNAUDIODEV was built on an older version of Solaris, the CD
|
||||||
|
## input device won't exist
|
||||||
|
try:
|
||||||
btn = Radiobutton(frame,
|
btn = Radiobutton(frame,
|
||||||
text='CD',
|
text='CD',
|
||||||
variable=self.__inputvar,
|
variable=self.__inputvar,
|
||||||
|
@ -108,6 +110,8 @@ class MainWindow:
|
||||||
if not info.i_avail_ports & CD:
|
if not info.i_avail_ports & CD:
|
||||||
btn.configure(state=DISABLED)
|
btn.configure(state=DISABLED)
|
||||||
buttons.append(btn)
|
buttons.append(btn)
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
#
|
#
|
||||||
# where does output go to?
|
# where does output go to?
|
||||||
frame = Frame(root, bd=1, relief=RAISED)
|
frame = Frame(root, bd=1, relief=RAISED)
|
||||||
|
@ -276,13 +280,18 @@ def main():
|
||||||
return
|
return
|
||||||
|
|
||||||
# spec: LONG OPT, SHORT OPT, 0=input,1=output, MASK
|
# spec: LONG OPT, SHORT OPT, 0=input,1=output, MASK
|
||||||
options = (('--microphone', '-m', 0, MICROPHONE),
|
options = [('--microphone', '-m', 0, MICROPHONE),
|
||||||
('--linein', '-i', 0, LINE_IN),
|
('--linein', '-i', 0, LINE_IN),
|
||||||
('--cd', '-c', 0, CD),
|
|
||||||
('--headphones', '-p', 1, HEADPHONE),
|
('--headphones', '-p', 1, HEADPHONE),
|
||||||
('--speaker', '-s', 1, SPEAKER),
|
('--speaker', '-s', 1, SPEAKER),
|
||||||
('--lineout', '-o', 1, LINE_OUT),
|
('--lineout', '-o', 1, LINE_OUT),
|
||||||
)
|
]
|
||||||
|
# See the comment above about `CD'
|
||||||
|
try:
|
||||||
|
options.append(('--cd', '-c', 0, CD))
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
|
|
||||||
info = device.getinfo()
|
info = device.getinfo()
|
||||||
# first get the existing values
|
# first get the existing values
|
||||||
for arg in sys.argv[1:]:
|
for arg in sys.argv[1:]:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue