summaryrefslogtreecommitdiff
path: root/paramiko/config.py
diff options
context:
space:
mode:
authorChris Rose <offline@offby1.net>2018-05-16 17:21:09 -0400
committerChris Rose <offline@offby1.net>2018-05-16 17:21:09 -0400
commit54384b3b8abaef9e5f80a582e97941b117d4a24a (patch)
tree1fbece7a805196f515e10c7e719092b82b74d54d /paramiko/config.py
parent543bb00c1e767eeb2c4cb43e8fddde79becf82e2 (diff)
downloadparamiko-54384b3b8abaef9e5f80a582e97941b117d4a24a.tar.gz
Jeffified
Diffstat (limited to 'paramiko/config.py')
-rw-r--r--paramiko/config.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/paramiko/config.py b/paramiko/config.py
index 35a5017d..cc757f1d 100644
--- a/paramiko/config.py
+++ b/paramiko/config.py
@@ -298,26 +298,34 @@ class LazyFqdn(object):
class SSHConfigDict(dict):
- """A dictionary wrapper for ssh host configurations.
+ """
+ A dictionary wrapper for ssh host configurations.
This class introduces some usage niceties for consumers of SSHConfig,
specifically around the issue of variable type conversions. This offers
as_bool(key) and as_int(key) for the current raw string values in
- SSHConfig"""
+ SSHConfig
+ """
def __init__(self, *args, **kwargs):
# Hey, guess what? Python 2's userdict is an old-style class!
super(SSHConfigDict, self).__init__(*args, **kwargs)
def as_bool(self, key):
- """Express the key as a boolean value. Variations on 'yes' or boolean values
- are accepted."""
+ """
+ Express the key as a boolean value.
+
+ Variations on 'yes' or boolean values are accepted.
+ """
val = self[key]
if isinstance(val, bool):
return val
return val.lower() == 'yes'
def as_int(self, key):
- """Express the key as a true integer, if possible. Raises an Error otherwise
- (following conventional int conversion rules)"""
+ """
+ Express the key as a true integer, if possible.
+
+ Raises an Error otherwise (following conventional int conversion rules)
+ """
return int(self[key])