summaryrefslogtreecommitdiffstats
path: root/Doc/library/mmap.rst
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-04-25 01:29:10 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-04-25 01:29:10 (GMT)
commitc7b05920d6536f7edba098d5018a470d35f2e864 (patch)
treece0f68baf5c7794f235604c64cde02c12aeed3de /Doc/library/mmap.rst
parent1c596d5604e4fc79944281ddc5baa666f6e27e85 (diff)
downloadcpython-c7b05920d6536f7edba098d5018a470d35f2e864.zip
cpython-c7b05920d6536f7edba098d5018a470d35f2e864.tar.gz
cpython-c7b05920d6536f7edba098d5018a470d35f2e864.tar.bz2
reformat some documentation of classes so methods and attributes are under the class directive
Diffstat (limited to 'Doc/library/mmap.rst')
-rw-r--r--Doc/library/mmap.rst124
1 files changed, 62 insertions, 62 deletions
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
index a9a4ad8..8b4685c 100644
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -137,111 +137,111 @@ memory but does not update the underlying file.
map.close()
-Memory-mapped file objects support the following methods:
+ Memory-mapped file objects support the following methods:
-.. method:: mmap.close()
+ .. method:: close()
- Close the file. Subsequent calls to other methods of the object will
- result in an exception being raised.
+ Close the file. Subsequent calls to other methods of the object will
+ result in an exception being raised.
-.. method:: mmap.find(string[, start[, end]])
+ .. method:: find(string[, start[, end]])
- Returns the lowest index in the object where the substring *string* is
- found, such that *string* is contained in the range [*start*, *end*].
- Optional arguments *start* and *end* are interpreted as in slice notation.
- Returns ``-1`` on failure.
+ Returns the lowest index in the object where the substring *string* is
+ found, such that *string* is contained in the range [*start*, *end*].
+ Optional arguments *start* and *end* are interpreted as in slice notation.
+ Returns ``-1`` on failure.
-.. method:: mmap.flush([offset, size])
+ .. method:: flush([offset, size])
- Flushes changes made to the in-memory copy of a file back to disk. Without
- use of this call there is no guarantee that changes are written back before
- the object is destroyed. If *offset* and *size* are specified, only
- changes to the given range of bytes will be flushed to disk; otherwise, the
- whole extent of the mapping is flushed.
+ Flushes changes made to the in-memory copy of a file back to disk. Without
+ use of this call there is no guarantee that changes are written back before
+ the object is destroyed. If *offset* and *size* are specified, only
+ changes to the given range of bytes will be flushed to disk; otherwise, the
+ whole extent of the mapping is flushed.
- **(Windows version)** A nonzero value returned indicates success; zero
- indicates failure.
+ **(Windows version)** A nonzero value returned indicates success; zero
+ indicates failure.
- **(Unix version)** A zero value is returned to indicate success. An
- exception is raised when the call failed.
+ **(Unix version)** A zero value is returned to indicate success. An
+ exception is raised when the call failed.
-.. method:: mmap.move(dest, src, count)
+ .. method:: move(dest, src, count)
- Copy the *count* bytes starting at offset *src* to the destination index
- *dest*. If the mmap was created with :const:`ACCESS_READ`, then calls to
- move will throw a :exc:`TypeError` exception.
+ Copy the *count* bytes starting at offset *src* to the destination index
+ *dest*. If the mmap was created with :const:`ACCESS_READ`, then calls to
+ move will throw a :exc:`TypeError` exception.
-.. method:: mmap.read(num)
+ .. method:: read(num)
- Return a string containing up to *num* bytes starting from the current file
- position; the file position is updated to point after the bytes that were
- returned.
+ Return a string containing up to *num* bytes starting from the current
+ file position; the file position is updated to point after the bytes that
+ were returned.
-.. method:: mmap.read_byte()
+ .. method:: read_byte()
- Returns a string of length 1 containing the character at the current file
- position, and advances the file position by 1.
+ Returns a string of length 1 containing the character at the current file
+ position, and advances the file position by 1.
-.. method:: mmap.readline()
+ .. method:: readline()
- Returns a single line, starting at the current file position and up to the
- next newline.
+ Returns a single line, starting at the current file position and up to the
+ next newline.
-.. method:: mmap.resize(newsize)
+ .. method:: resize(newsize)
- Resizes the map and the underlying file, if any. If the mmap was created
- with :const:`ACCESS_READ` or :const:`ACCESS_COPY`, resizing the map will
- throw a :exc:`TypeError` exception.
+ Resizes the map and the underlying file, if any. If the mmap was created
+ with :const:`ACCESS_READ` or :const:`ACCESS_COPY`, resizing the map will
+ throw a :exc:`TypeError` exception.
-.. method:: mmap.rfind(string[, start[, end]])
+ .. method:: rfind(string[, start[, end]])
- Returns the highest index in the object where the substring *string* is
- found, such that *string* is contained in the range [*start*, *end*].
- Optional arguments *start* and *end* are interpreted as in slice notation.
- Returns ``-1`` on failure.
+ Returns the highest index in the object where the substring *string* is
+ found, such that *string* is contained in the range [*start*, *end*].
+ Optional arguments *start* and *end* are interpreted as in slice notation.
+ Returns ``-1`` on failure.
-.. method:: mmap.seek(pos[, whence])
+ .. method:: seek(pos[, whence])
- Set the file's current position. *whence* argument is optional and
- defaults to ``os.SEEK_SET`` or ``0`` (absolute file positioning); other
- values are ``os.SEEK_CUR`` or ``1`` (seek relative to the current position)
- and ``os.SEEK_END`` or ``2`` (seek relative to the file's end).
+ Set the file's current position. *whence* argument is optional and
+ defaults to ``os.SEEK_SET`` or ``0`` (absolute file positioning); other
+ values are ``os.SEEK_CUR`` or ``1`` (seek relative to the current
+ position) and ``os.SEEK_END`` or ``2`` (seek relative to the file's end).
-.. method:: mmap.size()
+ .. method:: size()
- Return the length of the file, which can be larger than the size of the
- memory-mapped area.
+ Return the length of the file, which can be larger than the size of the
+ memory-mapped area.
-.. method:: mmap.tell()
+ .. method:: tell()
- Returns the current position of the file pointer.
+ Returns the current position of the file pointer.
-.. method:: mmap.write(string)
+ .. method:: write(string)
- Write the bytes in *string* into memory at the current position of the file
- pointer; the file position is updated to point after the bytes that were
- written. If the mmap was created with :const:`ACCESS_READ`, then writing to
- it will throw a :exc:`TypeError` exception.
+ Write the bytes in *string* into memory at the current position of the
+ file pointer; the file position is updated to point after the bytes that
+ were written. If the mmap was created with :const:`ACCESS_READ`, then
+ writing to it will throw a :exc:`TypeError` exception.
-.. method:: mmap.write_byte(byte)
+ .. method:: write_byte(byte)
- Write the single-character string *byte* into memory at the current
- position of the file pointer; the file position is advanced by ``1``. If
- the mmap was created with :const:`ACCESS_READ`, then writing to it will
- throw a :exc:`TypeError` exception.
+ Write the single-character string *byte* into memory at the current
+ position of the file pointer; the file position is advanced by ``1``. If
+ the mmap was created with :const:`ACCESS_READ`, then writing to it will
+ throw a :exc:`TypeError` exception.