Move ParamikoSSHVendor to dulwich.contrib.paramiko_vendor, to avoid import errors.
authorJelmer Vernooij <jelmer@jelmer.uk>
Sun, 13 Sep 2015 22:30:36 +0000 (22:30 +0000)
committerJelmer Vernooij <jelmer@jelmer.uk>
Sun, 13 Sep 2015 22:35:07 +0000 (22:35 +0000)
NEWS
dulwich/client.py
dulwich/contrib/paramiko_vendor.py [moved from dulwich/contrib/paramiko.py with 96% similarity]

diff --git a/NEWS b/NEWS
index 2326ebc1c3fd4b0e385b4bdc15ec3753900879d1..b5a73aa3c71ad48711798184acb949e6c7ab20ff 100644 (file)
--- a/NEWS
+++ b/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
 
index cf355cf1619931af1f855803c5b4efe6da5f289b..f8132542901e0b37bff151437ea06dc66eed66fc 100644 (file)
@@ -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),
similarity index 96%
rename from dulwich/contrib/paramiko.py
rename to dulwich/contrib/paramiko_vendor.py
index 182cbc6b021b2beeff11153b9f2d9ad08bc7fb83..5f8b7f82440d2a8b3df03a07d4536bdf6d3a8156 100644 (file)
@@ -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