summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2012-02-13 14:39:20 -0800
committerJeff Forcier <jeff@bitprophet.org>2012-09-23 16:10:50 -0700
commit9b2f36fc1f0aa0729a96dc2a973c285626599d1e (patch)
tree4d0067587b96ebb3c4d97ef3ebb34e75e838bc2f
parent1882f3470b8d16b56fd958e6dbd9e6c8a0666946 (diff)
downloadparamiko-9b2f36fc1f0aa0729a96dc2a973c285626599d1e.tar.gz
Whitespace tweaks, thanks @jaraco
(cherry picked from commit 3b20efcc141f6ddafe65fcdedba3800b817eb5f5)
-rw-r--r--paramiko/agent.py18
-rw-r--r--paramiko/win_pageant.py7
2 files changed, 12 insertions, 13 deletions
diff --git a/paramiko/agent.py b/paramiko/agent.py
index 3772d513..31dcaf8c 100644
--- a/paramiko/agent.py
+++ b/paramiko/agent.py
@@ -45,7 +45,7 @@ class AgentSSH(object):
local machine. If an SSH agent is running, this class can be used to
connect to it and retreive L{PKey} objects which can be used when
attempting to authenticate to remote SSH servers.
-
+
Because the SSH agent protocol uses environment variables and unix-domain
sockets, this probably doesn't work on Windows. It does work on most
posix platforms though (Linux and MacOS X, for example).
@@ -59,7 +59,7 @@ class AgentSSH(object):
Return the list of keys available through the SSH agent, if any. If
no SSH agent was running (or it couldn't be contacted), an empty list
will be returned.
-
+
@return: a list of keys available on the SSH agent
@rtype: tuple of L{AgentKey}
"""
@@ -195,7 +195,7 @@ class AgentClientProxy(object):
self.close()
def connect(self):
- """
+ """
Method automatically called by the run() method of the AgentProxyThread
"""
if ('SSH_AUTH_SOCK' in os.environ) and (sys.platform != 'win32'):
@@ -274,7 +274,7 @@ class AgentServerProxy(AgentSSH):
@return: the SSH_AUTH_SOCK Environnement variables
@rtype: dict
"""
- env = {}
+ env = {}
env['SSH_AUTH_SOCK'] = self._get_filename()
return env
@@ -287,18 +287,18 @@ class Agent(AgentSSH):
local machine. If an SSH agent is running, this class can be used to
connect to it and retreive L{PKey} objects which can be used when
attempting to authenticate to remote SSH servers.
-
+
Because the SSH agent protocol uses environment variables and unix-domain
sockets, this probably doesn't work on Windows. It does work on most
posix platforms though (Linux and MacOS X, for example).
"""
-
+
def __init__(self):
"""
Open a session with the local machine's SSH agent, if one is running.
If no agent is running, initialization will succeed, but L{get_keys}
will return an empty tuple.
-
+
@raise SSHException: if an SSH agent is found, but speaks an
incompatible protocol
"""
@@ -320,7 +320,7 @@ class Agent(AgentSSH):
else:
# no agent support
return
- self._connect(conn)
+ self._connect(conn)
def close(self):
"""
@@ -334,7 +334,7 @@ class AgentKey(PKey):
authenticating to a remote server (signing). Most other key operations
work as expected.
"""
-
+
def __init__(self, agent, blob):
self.agent = agent
self.blob = blob
diff --git a/paramiko/win_pageant.py b/paramiko/win_pageant.py
index 787032b8..16fa48e5 100644
--- a/paramiko/win_pageant.py
+++ b/paramiko/win_pageant.py
@@ -42,7 +42,6 @@ except ImportError:
except ImportError:
pass
-
_AGENT_COPYDATA_ID = 0x804e50ba
_AGENT_MAX_MSGLEN = 8192
# Note: The WM_COPYDATA value is pulled from win32con, as a workaround
@@ -108,7 +107,7 @@ def _query_pageant(msg):
response = ctypes.windll.user32.SendMessageA(hwnd, win32con_WM_COPYDATA, _size, _addr)
else:
response = 0
-
+
if response > 0:
datalen = pymap.read(4)
retlen = struct.unpack('>I', datalen)[0]
@@ -131,10 +130,10 @@ class PageantConnection (object):
def __init__(self):
self._response = None
-
+
def send(self, data):
self._response = _query_pageant(data)
-
+
def recv(self, n):
if self._response is None:
return ''