mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-105096: Reformat wave documentation (#105136)
Add ".. class::" markups in the wave documentation. * Reformat also wave.py (minor PEP 8 changes). * Remove redundant "import struct": it's already imported at top level. * Remove wave.rst from .nitignore
This commit is contained in:
parent
579c41c102
commit
85e5d03163
3 changed files with 136 additions and 129 deletions
|
@ -92,6 +92,7 @@ _array_fmts = None, 'b', 'h', None, 'i'
|
|||
_wave_params = namedtuple('_wave_params',
|
||||
'nchannels sampwidth framerate nframes comptype compname')
|
||||
|
||||
|
||||
def _byteswap(data, width):
|
||||
swapped_data = bytearray(len(data))
|
||||
|
||||
|
@ -104,7 +105,6 @@ def _byteswap(data, width):
|
|||
|
||||
class _Chunk:
|
||||
def __init__(self, file, align=True, bigendian=True, inclheader=False):
|
||||
import struct
|
||||
self.closed = False
|
||||
self.align = align # whether to align to word (2-byte) boundaries
|
||||
if bigendian:
|
||||
|
@ -214,7 +214,6 @@ class _Chunk:
|
|||
raise EOFError
|
||||
|
||||
|
||||
|
||||
class Wave_read:
|
||||
"""Variables used in this class:
|
||||
|
||||
|
@ -411,6 +410,7 @@ class Wave_read:
|
|||
self._comptype = 'NONE'
|
||||
self._compname = 'not compressed'
|
||||
|
||||
|
||||
class Wave_write:
|
||||
"""Variables used in this class:
|
||||
|
||||
|
@ -638,6 +638,7 @@ class Wave_write:
|
|||
self._file.seek(curpos, 0)
|
||||
self._datalength = self._datawritten
|
||||
|
||||
|
||||
def open(f, mode=None):
|
||||
if mode is None:
|
||||
if hasattr(f, 'mode'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue