Преглед на файлове

Move ParamikoSSHVendor to dulwich.contrib.paramiko_vendor, to avoid import errors.

Jelmer Vernooij преди 9 години
родител
ревизия
0563a518e1
променени са 3 файла, в които са добавени 11 реда и са изтрити 9 реда
  1. 3 2
      NEWS
  2. 5 5
      dulwich/client.py
  3. 3 2
      dulwich/contrib/paramiko_vendor.py

+ 3 - 2
NEWS

@@ -8,8 +8,9 @@
 
  CHANGES
 
-  * The ParamikoSSHVendor class has been moved to dulwich.contrib.paramiko,
-    as it's currently untested. (Jelmer Vernooij, #364)
+  * The ParamikoSSHVendor class has been moved to
+  * dulwich.contrib.paramiko_vendor, as it's currently untested.
+    (Jelmer Vernooij, #364)
 
 0.11.1	2015-09-13
 

+ 5 - 5
dulwich/client.py

@@ -872,9 +872,9 @@ class SubprocessSSHVendor(SSHVendor):
 def ParamikoSSHVendor(**kwargs):
     import warnings
     warnings.warn(
-        "ParamikoSSHVendor has been moved to dulwich.contrib.paramiko.",
+        "ParamikoSSHVendor has been moved to dulwich.contrib.paramiko_vendor.",
         DeprecationWarning)
-    from dulwich.contrib.paramiko import ParamikoSSHVendor
+    from dulwich.contrib.paramiko_vendor import ParamikoSSHVendor
     return ParamikoSSHVendor(**kwargs)
 
 
@@ -891,9 +891,9 @@ class SSHGitClient(TraditionalGitClient):
         TraditionalGitClient.__init__(self, **kwargs)
         self.alternative_paths = {}
         if vendor is not None:
-            self.vendor = vendor
+            self.ssh_vendor = vendor
         else:
-            self.vendor = get_ssh_vendor()
+            self.ssh_vendor = get_ssh_vendor()
 
     def _get_cmd_path(self, cmd):
         cmd = self.alternative_paths.get(cmd, b'git-' + cmd)
@@ -912,7 +912,7 @@ class SSHGitClient(TraditionalGitClient):
         if path.startswith(b"/~"):
             path = path[1:]
         argv = self._get_cmd_path(cmd) + [path]
-        con = self.vendor.run_command(
+        con = self.ssh_vendor.run_command(
             self.host, argv, port=self.port, username=self.username)
         return (Protocol(con.read, con.write, con.close,
                          report_activity=self._report_activity),

+ 3 - 2
dulwich/contrib/paramiko.py → dulwich/contrib/paramiko_vendor.py

@@ -1,4 +1,4 @@
-# paramako.py -- paramiko implementation of the Dulwich SSHVendor interface
+# paramiko_vendor.py -- paramiko implementation of the SSHVendor interface
 # Copyright (C) 2013 Aaron O'Mullan <aaron.omullan@friendco.de>
 #
 # This program is free software; you can redistribute it and/or
@@ -22,13 +22,14 @@ To use this implementation as the SSH implementation in Dulwich, override
 the dulwich.client.get_ssh_vendor attribute:
 
   >>> from dulwich import client as _mod_client
-  >>> from dulwich.contrib.paramiko import ParamikoSSHVendor
+  >>> from dulwich.contrib.paramiko_vendor import ParamikoSSHVendor
   >>> _mod_client.get_ssh_vendor = ParamikoSSHVendor
 
 This implementation is experimental and does not have any tests.
 """
 
 import paramiko
+import paramiko.client
 import subprocess
 import threading