]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
*** empty log message ***
authorGuido van Rossum <guido@python.org>
Tue, 24 Dec 1991 13:55:16 +0000 (13:55 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 24 Dec 1991 13:55:16 +0000 (13:55 +0000)
Demo/scripts/README
Demo/sgi/al/alwatch.py
Demo/sgi/al/intercom.py

index 7a2b837d9c98c4714c46ea4d74433db26f73604e..9cd4ca310c891b75447d0b25f82b980617c9445e 100644 (file)
@@ -1,11 +1,12 @@
 Contents of this directory:
 
 byteyears.py           Print product of a file's size and age
+checkpyc.py            Check presence and validity of ".pyc" files
+copytime.py            Copy one file's atime and mtime to another
 eptags.py              Create Emacs TAGS file for Python modules
 fact.py                        Factorize numbers
 findlinksto.py         Find symbolic links to a given path (prefix)
 from.py                        Summarize mailbox
-lfact.py               Factorize long numbers
 lpwatch.py             Watch BSD line printer queues
 mkreal.py              Turn a symbolic link into a real file or directory
 objgraph.py            Print object graph from nm output on a library
index 5af0935bcf48b2ee9cb1b999a673a8adadf90a2f..2b8acdd3449c91a37de4e68925f4f38edb966ff9 100755 (executable)
@@ -1,19 +1,40 @@
 import time
-import al
-dev = 1
-name = ['input source', 'left input atten', 'right input atten', \
+import al, AL
+import string
+
+dev = AL.DEFAULT_DEVICE
+
+parameter_name = [ \
+       'input source', 'left input atten', 'right input atten', \
        'input rate', 'output rate', \
        'left speaker gain', 'right speaker gain', \
        'input count', 'output count', 'unused count', \
        'sync input to aes', 'sync output to aes', \
        ]
-x = al.queryparams(dev)
-al.getparams(dev, x)
+source_name = ['line', 'microphone', 'digital']
+
+params = al.queryparams(dev)
+for i in range(1, len(params), 2):
+       params[i] = -1
 while 1:
        time.millisleep(100)
-       y = x[:]
-       al.getparams(dev, x)
-       if x <> y:
-               for i in range(0, len(x), 2):
-                       if x[i+1] <> y[i+1]:
-                               print name[x[i]], ':', y[i+1], '-->', x[i+1]
+       old = params[:]
+       al.getparams(dev, params)
+       if params <> old:
+               for i in range(0, len(params), 2):
+                       if params[i+1] <> old[i+1]:
+                               name = parameter_name[params[i]]
+                               if params[i] = AL.INPUT_SOURCE:
+                                       if 0 <= old[i+1] < len(source_name):
+                                               oldval = source_name[old[i+1]]
+                                       else:
+                                               oldval = ''
+                                       newval = source_name[params[i+1]]
+                               else:
+                                       oldval = `old[i+1]`
+                                       newval = `params[i+1]`
+                               print string.ljust(name, 20),
+                               print '(' + string.rjust(oldval, 10) + ')',
+                               print '-->',
+                               print string.rjust(newval, 10)
+               print
index f101c11f19abe98bf5587f25553a80c2403e4d07..2babb932ae6cfb59728a3a170d379e0274ce1151 100755 (executable)
@@ -44,10 +44,11 @@ def client(hostname):
        print 'client starting'
        cmd = 'rsh ' + hostname + ' "cd ' + AUDIODIR
        cmd = cmd + '; DISPLAY=:0; export DISPLAY'
-       cmd = cmd + '; exec ' + PYTHON + ' intercom.py -r '
+       cmd = cmd + '; ' + PYTHON + ' intercom.py -r '
        for flag in debug: cmd = cmd + flag + ' '
        cmd = cmd + gethostname()
        cmd = cmd + '"'
+       if debug: print cmd
        pipe = posix.popen(cmd, 'r')
        ack = 0
        nak = 0