mirror of
https://github.com/python/cpython.git
synced 2025-07-23 19:25:40 +00:00
new '==' syntax
This commit is contained in:
parent
453bd408bd
commit
14f43cf5dc
4 changed files with 12 additions and 12 deletions
|
@ -24,7 +24,7 @@ while 1:
|
||||||
for i in range(0, len(params), 2):
|
for i in range(0, len(params), 2):
|
||||||
if params[i+1] <> old[i+1]:
|
if params[i+1] <> old[i+1]:
|
||||||
name = parameter_name[params[i]]
|
name = parameter_name[params[i]]
|
||||||
if params[i] = AL.INPUT_SOURCE:
|
if params[i] == AL.INPUT_SOURCE:
|
||||||
if 0 <= old[i+1] < len(source_name):
|
if 0 <= old[i+1] < len(source_name):
|
||||||
oldval = source_name[old[i+1]]
|
oldval = source_name[old[i+1]]
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -28,8 +28,8 @@ def main():
|
||||||
remote = 0
|
remote = 0
|
||||||
opts, args = getopt.getopt(sys.argv[1:], 'rd')
|
opts, args = getopt.getopt(sys.argv[1:], 'rd')
|
||||||
for opt, arg in opts:
|
for opt, arg in opts:
|
||||||
if opt = '-r': remote = 1
|
if opt == '-r': remote = 1
|
||||||
elif opt = '-d': debug.append(opt)
|
elif opt == '-d': debug.append(opt)
|
||||||
if len(args) <> 1:
|
if len(args) <> 1:
|
||||||
msg = 'usage: intercom [-d] [-r] hostname'
|
msg = 'usage: intercom [-d] [-r] hostname'
|
||||||
msg = msg + ' (-r is for internal use only!)\n'
|
msg = msg + ' (-r is for internal use only!)\n'
|
||||||
|
@ -56,10 +56,10 @@ def client(hostname):
|
||||||
line = pipe.readline()
|
line = pipe.readline()
|
||||||
if not line: break
|
if not line: break
|
||||||
sys.stdout.write('remote: ' + line)
|
sys.stdout.write('remote: ' + line)
|
||||||
if line = 'NAK\n':
|
if line == 'NAK\n':
|
||||||
nak = 1
|
nak = 1
|
||||||
break
|
break
|
||||||
elif line = 'ACK\n':
|
elif line == 'ACK\n':
|
||||||
ack = 1
|
ack = 1
|
||||||
break
|
break
|
||||||
if nak:
|
if nak:
|
||||||
|
@ -135,7 +135,7 @@ def ioloop(s, otheraddr):
|
||||||
for i in range(0, len(params), 2):
|
for i in range(0, len(params), 2):
|
||||||
if params[i] in (AL.INPUT_RATE, AL.OUTPUT_RATE):
|
if params[i] in (AL.INPUT_RATE, AL.OUTPUT_RATE):
|
||||||
params[i+1] = AL.RATE_16000
|
params[i+1] = AL.RATE_16000
|
||||||
elif params[i] = AL.INPUT_SOURCE:
|
elif params[i] == AL.INPUT_SOURCE:
|
||||||
params[i+1] = AL.INPUT_MIC
|
params[i+1] = AL.INPUT_MIC
|
||||||
try:
|
try:
|
||||||
al.setparams(dev, params)
|
al.setparams(dev, params)
|
||||||
|
@ -166,7 +166,7 @@ def ioloop1(s, otheraddr):
|
||||||
spkr = al.openport('spkr', 'w', config)
|
spkr = al.openport('spkr', 'w', config)
|
||||||
while 1:
|
while 1:
|
||||||
data = s.recv(BUFSIZE)
|
data = s.recv(BUFSIZE)
|
||||||
if len(data) = 0:
|
if len(data) == 0:
|
||||||
# EOF packet
|
# EOF packet
|
||||||
log('parent got empty packet; killing child')
|
log('parent got empty packet; killing child')
|
||||||
posix.kill(pid, 15)
|
posix.kill(pid, 15)
|
||||||
|
|
|
@ -22,11 +22,11 @@ def main():
|
||||||
except EOFError:
|
except EOFError:
|
||||||
break
|
break
|
||||||
if v: print 'header:', `type`, size
|
if v: print 'header:', `type`, size
|
||||||
if type = 'COMM':
|
if type == 'COMM':
|
||||||
nchannels, nsampframes, sampwidth, samprate = \
|
nchannels, nsampframes, sampwidth, samprate = \
|
||||||
aiff.read_comm_chunk(f)
|
aiff.read_comm_chunk(f)
|
||||||
if v: print nchannels, nsampframes, sampwidth, samprate
|
if v: print nchannels, nsampframes, sampwidth, samprate
|
||||||
elif type = 'SSND':
|
elif type == 'SSND':
|
||||||
offset, blocksize = aiff.read_ssnd_chunk(f)
|
offset, blocksize = aiff.read_ssnd_chunk(f)
|
||||||
if v: print offset, blocksize
|
if v: print offset, blocksize
|
||||||
data = f.read(size-8)
|
data = f.read(size-8)
|
||||||
|
|
|
@ -19,11 +19,11 @@ def main():
|
||||||
#
|
#
|
||||||
magic = f.read(4)
|
magic = f.read(4)
|
||||||
extra = ''
|
extra = ''
|
||||||
if magic = '0008':
|
if magic == '0008':
|
||||||
rate = 8000
|
rate = 8000
|
||||||
elif magic = '0016':
|
elif magic == '0016':
|
||||||
rate = 16000
|
rate = 16000
|
||||||
elif magic = '0032':
|
elif magic == '0032':
|
||||||
rate = 32000
|
rate = 32000
|
||||||
else:
|
else:
|
||||||
sys.stderr.write('no magic header; assuming 8k samples/sec.\n')
|
sys.stderr.write('no magic header; assuming 8k samples/sec.\n')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue