From f7b892905c62b94a6e54d115ee2d6d32d66af013 Mon Sep 17 00:00:00 2001 From: "Jeremy T. Bouse" Date: Fri, 27 Nov 2009 16:25:55 -0500 Subject: Imported Upstream version 1.7.6 Closes: #543784 --- docs/paramiko.win_pageant-pysrc.html | 68 ++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'docs/paramiko.win_pageant-pysrc.html') diff --git a/docs/paramiko.win_pageant-pysrc.html b/docs/paramiko.win_pageant-pysrc.html index 6b062ee..3ff1f48 100644 --- a/docs/paramiko.win_pageant-pysrc.html +++ b/docs/paramiko.win_pageant-pysrc.html @@ -55,24 +55,24 @@

Source Code for Module paramiko.win_pageant

   1  # Copyright (C) 2005 John Arbash-Meinel <john@arbash-meinel.com> 
-  2  # Modified up by: Todd Whiteman <ToddW@ActiveState.com> 
-  3  # 
-  4  # This file is part of paramiko. 
-  5  # 
-  6  # Paramiko is free software; you can redistribute it and/or modify it under the 
-  7  # terms of the GNU Lesser General Public License as published by the Free 
-  8  # Software Foundation; either version 2.1 of the License, or (at your option) 
-  9  # any later version. 
- 10  # 
- 11  # Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY 
- 12  # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 
- 13  # A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more 
- 14  # details. 
- 15  # 
- 16  # You should have received a copy of the GNU Lesser General Public License 
- 17  # along with Paramiko; if not, write to the Free Software Foundation, Inc., 
- 18  # 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA. 
- 19   
+  2  # Modified up by: Todd Whiteman <ToddW@ActiveState.com> 
+  3  # 
+  4  # This file is part of paramiko. 
+  5  # 
+  6  # Paramiko is free software; you can redistribute it and/or modify it under the 
+  7  # terms of the GNU Lesser General Public License as published by the Free 
+  8  # Software Foundation; either version 2.1 of the License, or (at your option) 
+  9  # any later version. 
+ 10  # 
+ 11  # Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY 
+ 12  # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 
+ 13  # A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more 
+ 14  # details. 
+ 15  # 
+ 16  # You should have received a copy of the GNU Lesser General Public License 
+ 17  # along with Paramiko; if not, write to the Free Software Foundation, Inc., 
+ 18  # 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA. 
+ 19   
  20  """ 
  21  Functions for communicating with Pageant, the basic windows ssh agent program. 
  22  """ 
@@ -84,12 +84,12 @@
  28  import array 
  29   
  30  # if you're on windows, you should have one of these, i guess? 
- 31  # ctypes is part of standard library since Python 2.5 
- 32  _has_win32all = False 
+ 31  # ctypes is part of standard library since Python 2.5 
+ 32  _has_win32all = False 
  33  _has_ctypes = False 
  34  try: 
  35      # win32gui is preferred over win32ui to avoid MFC dependencies 
- 36      import win32gui 
+ 36      import win32gui 
  37      _has_win32all = True 
  38  except ImportError: 
  39      try: 
@@ -102,8 +102,8 @@
  46  _AGENT_COPYDATA_ID = 0x804e50ba 
  47  _AGENT_MAX_MSGLEN = 8192 
  48  # Note: The WM_COPYDATA value is pulled from win32con, as a workaround 
- 49  # so we do not have to import this huge library just for this one variable. 
- 50  win32con_WM_COPYDATA = 74 
+ 49  # so we do not have to import this huge library just for this one variable. 
+ 50  win32con_WM_COPYDATA = 74 
  51   
  52   
 
53 -def _get_pageant_window_object(): @@ -116,7 +116,7 @@ paramiko.rng_win32.error" class="py-name" href="#" onclick="return doclink('link 59 pass 60 elif _has_ctypes: 61 # Return 0 if there is no Pageant window. - 62 return ctypes.windll.user32.FindWindowA('Pageant', 'Pageant') + 62 return ctypes.windll.user32.FindWindowA('Pageant', 'Pageant') 63 return None
64 65 @@ -136,33 +136,33 @@ paramiko.rng_win32.error" class="py-name" href="#" onclick="return doclink('link
79 hwnd = _get_pageant_window_object() 80 if not hwnd: 81 # Raise a failure to connect exception, pageant isn't running anymore! - 82 return None + 82 return None 83 84 # Write our pageant request string into the file (pageant will read this to determine what to do) - 85 filename = tempfile.mktemp('.pag') + 85 filename = tempfile.mktemp('.pag') 86 map_filename = os.path.basename(filename) 87 88 f = open(filename, 'w+b') 89 f.write(msg ) 90 # Ensure the rest of the file is empty, otherwise pageant will read this - 91 f. 91 f.write('\0' * (_AGENT_MAX_MSGLEN - len(msg))) 92 # Create the shared file map that pageant will use to read from - 93 pymap = mmap.mmap(f. 93 pymap = mmap.mmap(f.fileno(), _AGENT_MAX_MSGLEN, tagname=map_filename, access=mmap.ACCESS_WRITE) 94 try: 95 # Create an array buffer containing the mapped filename - 96 char_buffer = array.array("c", map_filename + '\0') + 96 char_buffer = array.array("c", map_filename + '\0') 97 char_buffer_address, char_buffer_size = char_buffer.buffer_info() 98 # Create a string to use for the SendMessage function call - 99 cds = struct.pack("LLP", _AGENT_COPYDATA_ID, char_buffer_size, char_buffer_address) + 99 cds = struct.pack("LLP", _AGENT_COPYDATA_ID, char_buffer_size, char_buffer_address) 100 101 if _has_win32all: 102 # win32gui.SendMessage should also allow the same pattern as -103 # ctypes, but let's keep it like this for now... -104 response = win32gui.SendMessage(hwnd, win32con_WM_COPYDATA, len(cds), cds) +103 # ctypes, but let's keep it like this for now... +104 response = win32gui.SendMessage(hwnd, win32con_WM_COPYDATA, len(cds), cds) 105 elif _has_ctypes: 106 _buf = array.array('B', cds) 107 _addr, _size = _buf.buffer_info() @@ -205,7 +205,7 @@ paramiko.pipe.PosixPipe.close paramiko.pipe.WindowsPipe.close paramiko.win_pageant.PageantConnection.close" class="py-name" href="#" onclick="return doclink('link-26', 'close', 'link-25');">close() 120 # Remove the file, it was temporary only -121 os.unlink(filename) +121 os.unlink(filename)
122 123
124 -class PageantConnection (object): @@ -266,7 +266,7 @@ expandto(location.href);