diff options
author | Rob Crittenden <rcritten@redhat.com> | 2009-08-11 17:08:09 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-08-12 13:18:15 -0400 |
commit | 8780751330871033b13fc8fbb7eb0588baf4417d (patch) | |
tree | 0b21cac0974b193c67c43e22fb7b21983766fbf8 /ipapython/ipasslfile.py | |
parent | c781e8a57d3d05fa07729dbccff07bc1fab9d8e8 (diff) | |
download | freeipa-8780751330871033b13fc8fbb7eb0588baf4417d.tar.gz freeipa-8780751330871033b13fc8fbb7eb0588baf4417d.tar.xz freeipa-8780751330871033b13fc8fbb7eb0588baf4417d.zip |
Clean up some problems discovered with pylint and pychecker
Much of this is formatting to make pylint happy but it also fixes some
real bugs.
Diffstat (limited to 'ipapython/ipasslfile.py')
-rw-r--r-- | ipapython/ipasslfile.py | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/ipapython/ipasslfile.py b/ipapython/ipasslfile.py index 5525ab9b5..5f4ea2a7b 100644 --- a/ipapython/ipasslfile.py +++ b/ipapython/ipasslfile.py @@ -15,6 +15,10 @@ # the reference counting and SharedSocketClient provides an constructor # and close() method that call incref() and decref() correctly. +import socket +import errno +from httplib import UnimplementedFileMode + class SharedSocket: def __init__(self, sock): self.sock = sock @@ -91,13 +95,13 @@ class SSLFile(SharedSocketClient): break L.append(s) avail += len(s) - all = "".join(L) + alldata = "".join(L) if size is None: self._buf = '' - return all + return alldata else: - self._buf = all[size:] - return all[:size] + self._buf = alldata[size:] + return alldata[:size] def readline(self): L = [self._buf] @@ -114,25 +118,25 @@ class SSLFile(SharedSocketClient): # loop exited because there is no more data return "".join(L) else: - all = "".join(L) + alldata = "".join(L) # XXX could do enough bookkeeping not to do a 2nd search - i = all.find("\n") + 1 - line = all[:i] - self._buf = all[i:] + i = alldata.find("\n") + 1 + line = alldata[:i] + self._buf = alldata[i:] return line def readlines(self, sizehint=0): total = 0 - list = [] + inlist = [] while True: line = self.readline() if not line: break - list.append(line) + inlist.append(line) total += len(line) if sizehint and total >= sizehint: break - return list + return inlist def fileno(self): return self._sock.fileno() |