summaryrefslogtreecommitdiffstats
path: root/Lib/sunaudio.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-02-04 15:28:42 (GMT)
committerGuido van Rossum <guido@python.org>2000-02-04 15:28:42 (GMT)
commite7b146fb3bdca62a0d5ecc06dbf3348e5a4fe757 (patch)
treee1dda862f680cf4a1169220af2ecbca3322caf4d /Lib/sunaudio.py
parent54f22ed30bab2e64909ba2d79205cb4b87c69db2 (diff)
downloadcpython-e7b146fb3bdca62a0d5ecc06dbf3348e5a4fe757.zip
cpython-e7b146fb3bdca62a0d5ecc06dbf3348e5a4fe757.tar.gz
cpython-e7b146fb3bdca62a0d5ecc06dbf3348e5a4fe757.tar.bz2
The third and final doc-string sweep by Ka-Ping Yee.
The attached patches update the standard library so that all modules have docstrings beginning with one-line summaries. A new docstring was added to formatter. The docstring for os.py was updated to mention nt, os2, ce in addition to posix, dos, mac.
Diffstat (limited to 'Lib/sunaudio.py')
-rw-r--r--Lib/sunaudio.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/Lib/sunaudio.py b/Lib/sunaudio.py
index 96def15..b7df71c 100644
--- a/Lib/sunaudio.py
+++ b/Lib/sunaudio.py
@@ -1,19 +1,17 @@
-# Module 'sunaudio' -- interpret sun audio headers
+"""Interpret sun audio headers."""
MAGIC = '.snd'
error = 'sunaudio sound header conversion error'
-# convert a 4-char value to integer
-
def get_long_be(s):
+ """Convert a 4-char value to integer."""
return (ord(s[0])<<24) | (ord(s[1])<<16) | (ord(s[2])<<8) | ord(s[3])
-# read a sound header from an open file
-
def gethdr(fp):
+ """Read a sound header from an open file."""
if fp.read(4) <> MAGIC:
raise error, 'gethdr: bad magic word'
hdr_size = get_long_be(fp.read(4))
@@ -31,9 +29,8 @@ def gethdr(fp):
return (data_size, encoding, sample_rate, channels, info)
-# read and print the sound header of a named file
-
def printhdr(file):
+ """Read and print the sound header of a named file."""
hdr = gethdr(open(file, 'r'))
data_size, encoding, sample_rate, channels, info = hdr
while info[-1:] == '\0':