diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-04-25 01:59:09 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-04-25 01:59:09 (GMT) |
commit | e41251e864e94885d785b5a9bf8f824753316296 (patch) | |
tree | f530db7682d71f4920b22b8d7f84c89727647ab5 /Doc/library/chunk.rst | |
parent | 768db92b438038586c1580b711c528363a97d3f4 (diff) | |
download | cpython-e41251e864e94885d785b5a9bf8f824753316296.zip cpython-e41251e864e94885d785b5a9bf8f824753316296.tar.gz cpython-e41251e864e94885d785b5a9bf8f824753316296.tar.bz2 |
Merged revisions 62490 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r62490 | benjamin.peterson | 2008-04-24 20:29:10 -0500 (Thu, 24 Apr 2008) | 2 lines
reformat some documentation of classes so methods and attributes are under the class directive
........
Diffstat (limited to 'Doc/library/chunk.rst')
-rw-r--r-- | Doc/library/chunk.rst | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/Doc/library/chunk.rst b/Doc/library/chunk.rst index 2e1798d..64ce4e2 100644 --- a/Doc/library/chunk.rst +++ b/Doc/library/chunk.rst @@ -66,62 +66,64 @@ instance will fail with a :exc:`EOFError` exception. optional argument *inclheader* is true, the size given in the chunk header includes the size of the header. The default value is false. -A :class:`Chunk` object supports the following methods: + A :class:`Chunk` object supports the following methods: -.. method:: Chunk.getname() + .. method:: getname() - Returns the name (ID) of the chunk. This is the first 4 bytes of the chunk. + Returns the name (ID) of the chunk. This is the first 4 bytes of the + chunk. -.. method:: Chunk.getsize() + .. method:: getsize() - Returns the size of the chunk. + Returns the size of the chunk. -.. method:: Chunk.close() + .. method:: close() - Close and skip to the end of the chunk. This does not close the underlying - file. + Close and skip to the end of the chunk. This does not close the + underlying file. -The remaining methods will raise :exc:`IOError` if called after the -:meth:`close` method has been called. + The remaining methods will raise :exc:`IOError` if called after the + :meth:`close` method has been called. -.. method:: Chunk.isatty() + .. method:: isatty() - Returns ``False``. + Returns ``False``. -.. method:: Chunk.seek(pos[, whence]) + .. method:: seek(pos[, whence]) - Set the chunk's current position. The *whence* argument is optional and - defaults to ``0`` (absolute file positioning); other values are ``1`` (seek - relative to the current position) and ``2`` (seek relative to the file's end). - There is no return value. If the underlying file does not allow seek, only - forward seeks are allowed. + Set the chunk's current position. The *whence* argument is optional and + defaults to ``0`` (absolute file positioning); other values are ``1`` + (seek relative to the current position) and ``2`` (seek relative to the + file's end). There is no return value. If the underlying file does not + allow seek, only forward seeks are allowed. -.. method:: Chunk.tell() + .. method:: tell() - Return the current position into the chunk. + Return the current position into the chunk. -.. method:: Chunk.read([size]) + .. method:: read([size]) - Read at most *size* bytes from the chunk (less if the read hits the end of the - chunk before obtaining *size* bytes). If the *size* argument is negative or - omitted, read all data until the end of the chunk. The bytes are returned as a - string object. An empty string is returned when the end of the chunk is - encountered immediately. + Read at most *size* bytes from the chunk (less if the read hits the end of + the chunk before obtaining *size* bytes). If the *size* argument is + negative or omitted, read all data until the end of the chunk. The bytes + are returned as a string object. An empty string is returned when the end + of the chunk is encountered immediately. -.. method:: Chunk.skip() + .. method:: skip() + + Skip to the end of the chunk. All further calls to :meth:`read` for the + chunk will return ``''``. If you are not interested in the contents of + the chunk, this method should be called so that the file points to the + start of the next chunk. - Skip to the end of the chunk. All further calls to :meth:`read` for the chunk - will return ``''``. If you are not interested in the contents of the chunk, - this method should be called so that the file points to the start of the next - chunk. .. rubric:: Footnotes |