From 3b20efcc141f6ddafe65fcdedba3800b817eb5f5 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Mon, 13 Feb 2012 14:39:20 -0800 Subject: [PATCH] Whitespace tweaks, thanks @jaraco --- ssh/agent.py | 18 +++++++++--------- ssh/win_pageant.py | 7 +++---- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/ssh/agent.py b/ssh/agent.py index abe3e45..08aceca 100644 --- a/ssh/agent.py +++ b/ssh/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/ssh/win_pageant.py b/ssh/win_pageant.py index 262e91d..6d0b356 100644 --- a/ssh/win_pageant.py +++ b/ssh/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 ''