Prechádzať zdrojové kódy

Rename _ssh_sock() to fix code style issue.

Since _ssh_sock is imported out of the git_command module, the leading
underscore should be removed from the function name.
Nico Sallembien 16 rokov pred
rodič
commit
1c85f4e43b
2 zmenil súbory, kde vykonal 5 pridanie a 5 odobranie
  1. 2 2
      git_command.py
  2. 3 3
      git_config.py

+ 2 - 2
git_command.py

@@ -30,7 +30,7 @@ LAST_CWD = None
 _ssh_proxy_path = None
 _ssh_proxy_path = None
 _ssh_sock_path = None
 _ssh_sock_path = None
 
 
-def _ssh_sock(create=True):
+def ssh_sock(create=True):
   global _ssh_sock_path
   global _ssh_sock_path
   if _ssh_sock_path is None:
   if _ssh_sock_path is None:
     if not create:
     if not create:
@@ -119,7 +119,7 @@ class GitCommand(object):
     if disable_editor:
     if disable_editor:
       env['GIT_EDITOR'] = ':'
       env['GIT_EDITOR'] = ':'
     if ssh_proxy:
     if ssh_proxy:
-      env['REPO_SSH_SOCK'] = _ssh_sock()
+      env['REPO_SSH_SOCK'] = ssh_sock()
       env['GIT_SSH'] = _ssh_proxy()
       env['GIT_SSH'] = _ssh_proxy()
 
 
     if project:
     if project:

+ 3 - 3
git_config.py

@@ -23,7 +23,7 @@ from signal import SIGTERM
 from urllib2 import urlopen, HTTPError
 from urllib2 import urlopen, HTTPError
 from error import GitError, UploadError
 from error import GitError, UploadError
 from trace import Trace
 from trace import Trace
-from git_command import GitCommand, _ssh_sock
+from git_command import GitCommand, ssh_sock
 
 
 R_HEADS = 'refs/heads/'
 R_HEADS = 'refs/heads/'
 R_TAGS  = 'refs/tags/'
 R_TAGS  = 'refs/tags/'
@@ -371,7 +371,7 @@ def _open_ssh(host, port):
     return False
     return False
 
 
   command = ['ssh',
   command = ['ssh',
-             '-o','ControlPath %s' % _ssh_sock(),
+             '-o','ControlPath %s' % ssh_sock(),
              '-p',str(port),
              '-p',str(port),
              '-M',
              '-M',
              '-N',
              '-N',
@@ -399,7 +399,7 @@ def close_ssh():
       pass
       pass
   _ssh_cache.clear()
   _ssh_cache.clear()
 
 
-  d = _ssh_sock(create=False)
+  d = ssh_sock(create=False)
   if d:
   if d:
     try:
     try:
       os.rmdir(os.path.dirname(d))
       os.rmdir(os.path.dirname(d))