Fix a bunch of indentation errors.
Maybe that whitespace merge flag was not so great an idea.
This commit is contained in:
parent
b2be63ec62
commit
7e8623f06f
|
@ -135,7 +135,7 @@ class SSHClient (object):
|
|||
with open(filename, 'w') as f:
|
||||
for hostname, keys in self._host_keys.items():
|
||||
for keytype, key in keys.items():
|
||||
f.write('%s %s %s\n' % (hostname, keytype, key.get_base64()))
|
||||
f.write('%s %s %s\n' % (hostname, keytype, key.get_base64()))
|
||||
|
||||
def get_host_keys(self):
|
||||
"""
|
||||
|
|
|
@ -86,20 +86,20 @@ class BufferedFile (object):
|
|||
return
|
||||
|
||||
if PY2:
|
||||
def next(self):
|
||||
"""
|
||||
Returns the next line from the input, or raises
|
||||
`~exceptions.StopIteration` when EOF is hit. Unlike Python file
|
||||
objects, it's okay to mix calls to `next` and `readline`.
|
||||
def next(self):
|
||||
"""
|
||||
Returns the next line from the input, or raises
|
||||
`~exceptions.StopIteration` when EOF is hit. Unlike Python file
|
||||
objects, it's okay to mix calls to `next` and `readline`.
|
||||
|
||||
:raises StopIteration: when the end of the file is reached.
|
||||
:raises StopIteration: when the end of the file is reached.
|
||||
|
||||
:return: a line (`str`) read from the file.
|
||||
"""
|
||||
line = self.readline()
|
||||
if not line:
|
||||
raise StopIteration
|
||||
return line
|
||||
:return: a line (`str`) read from the file.
|
||||
"""
|
||||
line = self.readline()
|
||||
if not line:
|
||||
raise StopIteration
|
||||
return line
|
||||
else:
|
||||
def __next__(self):
|
||||
"""
|
||||
|
|
|
@ -257,7 +257,7 @@ class Message (object):
|
|||
self.packet.write(max_byte)
|
||||
self.add_string(util.deflate_long(n))
|
||||
else:
|
||||
self.packet.write(struct.pack('>I', n))
|
||||
self.packet.write(struct.pack('>I', n))
|
||||
return self
|
||||
|
||||
def add_int64(self, n):
|
||||
|
|
|
@ -253,8 +253,8 @@ class PKey (object):
|
|||
:raises SSHException: if the key file is invalid.
|
||||
"""
|
||||
with open(filename, 'r') as f:
|
||||
data = self._read_private_key(tag, f, password)
|
||||
return data
|
||||
data = self._read_private_key(tag, f, password)
|
||||
return data
|
||||
|
||||
def _read_private_key(self, tag, f, password=None):
|
||||
lines = f.readlines()
|
||||
|
|
|
@ -114,14 +114,14 @@ class ModulusPack (object):
|
|||
"""
|
||||
self.pack = {}
|
||||
with open(filename, 'r') as f:
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
if (len(line) == 0) or (line[0] == '#'):
|
||||
continue
|
||||
try:
|
||||
self._parse_modulus(line)
|
||||
except:
|
||||
continue
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
if (len(line) == 0) or (line[0] == '#'):
|
||||
continue
|
||||
try:
|
||||
self._parse_modulus(line)
|
||||
except:
|
||||
continue
|
||||
|
||||
def get_modulus(self, min, prefer, max):
|
||||
bitsizes = sorted(self.pack.keys())
|
||||
|
|
|
@ -526,8 +526,8 @@ class SFTPClient(BaseSFTP):
|
|||
Began returning rich attribute objects.
|
||||
"""
|
||||
with self.file(remotepath, 'wb') as fr:
|
||||
fr.set_pipelined(True)
|
||||
size = 0
|
||||
fr.set_pipelined(True)
|
||||
size = 0
|
||||
while True:
|
||||
data = fl.read(32768)
|
||||
fr.write(data)
|
||||
|
@ -593,8 +593,8 @@ class SFTPClient(BaseSFTP):
|
|||
Added the ``callable`` param.
|
||||
"""
|
||||
with self.open(remotepath, 'rb') as fr:
|
||||
file_size = self.stat(remotepath).st_size
|
||||
fr.prefetch()
|
||||
file_size = self.stat(remotepath).st_size
|
||||
fr.prefetch()
|
||||
size = 0
|
||||
while True:
|
||||
data = fr.read(32768)
|
||||
|
|
|
@ -131,7 +131,7 @@ def bit_length(n):
|
|||
try:
|
||||
return n.bitlength()
|
||||
except AttributeError:
|
||||
norm = deflate_long(n, 0)
|
||||
norm = deflate_long(n, 0)
|
||||
hbyte = byte_ord(norm[0])
|
||||
if hbyte == 0:
|
||||
return 1
|
||||
|
|
Loading…
Reference in New Issue