summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOlle Lundberg <geek@nerd.sh>2012-10-16 15:00:02 +0200
committerOlle Lundberg <geek@nerd.sh>2013-02-28 12:10:55 +0100
commit42d77483e846db5e43296d7055d059e43168dab7 (patch)
treecd5a5d5d28a0c9e06638d51076e14747fa349221
parent85551dffd6d6008cf0409ee776d6792a8e51468f (diff)
Pep8 fixes
-rw-r--r--paramiko/config.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/paramiko/config.py b/paramiko/config.py
index 3f2703ea..a31dffc1 100644
--- a/paramiko/config.py
+++ b/paramiko/config.py
@@ -26,7 +26,6 @@ import os
import re
import socket
-
SSH_PORT = 22
proxy_re = re.compile(r"^(proxycommand)\s*=*\s*(.*)", re.I)
@@ -85,7 +84,6 @@ class SSHConfig (object):
"""
self._config = []
-
def parse(self, file_obj):
"""
Read an OpenSSH config from the given file object.
@@ -93,7 +91,7 @@ class SSHConfig (object):
@param file_obj: a file-like object to read the config file from
@type file_obj: file
"""
- host = {"host":['*'],"config":{}}
+ host = {"host": ['*'], "config": {}}
for line in file_obj:
line = line.rstrip('\n').lstrip()
if (line == '') or (line[0] == '#'):
@@ -119,7 +117,7 @@ class SSHConfig (object):
if key == 'host':
self._config.append(host)
value = value.split()
- host = {key:value,'config':{}}
+ host = {key: value, 'config': {}}
#identityfile is a special case, since it is allowed to be
# specified multiple times and they should be tried in order
# of specification.
@@ -129,7 +127,7 @@ class SSHConfig (object):
else:
host['config']['identityfile'] = [value]
elif key not in host['config']:
- host['config'].update({key:value})
+ host['config'].update({key: value})
self._config.append(host)
def lookup(self, hostname):
@@ -152,8 +150,8 @@ class SSHConfig (object):
@type hostname: str
"""
- matches = [ config for config in self._config if
- self._allowed(hostname,config['host']) ]
+ matches = [config for config in self._config if
+ self._allowed(hostname, config['host'])]
ret = {}
for match in matches:
@@ -193,7 +191,7 @@ class SSHConfig (object):
"""
if 'hostname' in config:
- config['hostname'] = config['hostname'].replace('%h',hostname)
+ config['hostname'] = config['hostname'].replace('%h', hostname)
else:
config['hostname'] = hostname
@@ -235,12 +233,14 @@ class SSHConfig (object):
('%r', remoteuser),
],
}
+
for k in config:
if k in replacements:
for find, replace in replacements[k]:
- if isinstance(config[k],list):
+ if isinstance(config[k], list):
for item in range(len(config[k])):
- config[k][item] = config[k][item].replace(find, str(replace))
+ config[k][item] = config[k][item].\
+ replace(find, str(replace))
else:
config[k] = config[k].replace(find, str(replace))
return config