diff options
author | Robey Pointer <robey@lag.net> | 2004-03-08 17:45:44 +0000 |
---|---|---|
committer | Robey Pointer <robey@lag.net> | 2004-03-08 17:45:44 +0000 |
commit | 9f6bbb651997eac01f5385419f78c26144712548 (patch) | |
tree | 5ac3238f403a1e8332369903427a02284a273b28 | |
parent | c565d66e390f613f776146665bebbe63a163b0e2 (diff) |
[project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-29]
fix some docs and BufferedFile.readline
fix some documentation and fix readline()'s universal newline support to
always return strings ending with '\n', regardless of how they were in the
original file. (this is an obvious feature of python's universal newline
support that i somehow missed before.)
-rw-r--r-- | paramiko/file.py | 10 | ||||
-rw-r--r-- | paramiko/message.py | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/paramiko/file.py b/paramiko/file.py index d19ec30e..3b9812a8 100644 --- a/paramiko/file.py +++ b/paramiko/file.py @@ -59,7 +59,7 @@ class BufferedFile (object): file. This iterator happens to return the file itself, since a file is its own iterator. - @raise: ValueError if the file is closed. + @raise ValueError: if the file is closed. @return: an interator. @rtype: iterator @@ -90,7 +90,7 @@ class BufferedFile (object): EOF is hit. Unlike python file objects, it's okay to mix calls to C{next} and L{readline}. - @raise: StopIteration when the end of the file is reached. + @raise StopIteration: when the end of the file is reached. @return: a line read from the file. @rtype: string @@ -161,7 +161,7 @@ class BufferedFile (object): EOF is encountered immediately. @note: Unlike stdio's C{fgets()}, the returned string contains null - characters (C{'\0'}) if they occurred in the input. + characters (C{'\\0'}) if they occurred in the input. @param size: maximum length of returned string. @type size: int @@ -218,7 +218,7 @@ class BufferedFile (object): xpos += 1 self._rbuffer = line[xpos:] lf = line[pos:xpos] - line = line[:xpos] + line = line[:pos] + '\n' if (len(self._rbuffer) == 0) and (lf == '\r'): # we could read the line up to a '\r' and there could still be a # '\n' following that we read next time. note that and eat it. @@ -286,7 +286,7 @@ class BufferedFile (object): def write(self, data): """ Write data to the file. If write buffering is on (C{bufsize} was - specified and non-zero, some or all of the data may not actually be + specified and non-zero), some or all of the data may not actually be written yet. (Use L{flush} or L{close} to force buffered data to be written out.) diff --git a/paramiko/message.py b/paramiko/message.py index 78fd4d78..86154649 100644 --- a/paramiko/message.py +++ b/paramiko/message.py @@ -182,7 +182,7 @@ class Message (object): as comma-separated values in a string. @return: a list of strings. - @type: list of strings + @rtype: list of strings """ str = self.get_string() l = string.split(str, ',') |