]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/ssh.py
do_bloom(): remove unused "count" variable
[bup.git] / lib / bup / ssh.py
index f91e16dcb34bc9ce1d755704b2c1a8f96db439b3..344355aa1f2b537140b36367d5d4b4d4e56021ab 100644 (file)
@@ -1,20 +1,14 @@
 """SSH connection.
 Connect to a remote host via SSH and execute a command on the host.
 """
-import os
-import sys
-import re
-import subprocess
-
-from bup import helpers
+import sys, os, re, subprocess
+from bup import helpers, path
 
 
 def connect(rhost, port, subcmd):
     """Connect to 'rhost' and execute the bup subcommand 'subcmd' on it."""
     assert(not re.search(r'[^\w-]', subcmd))
-    main_exe = os.environ.get('BUP_MAIN_EXE') or sys.argv[0]
-    nicedir = os.path.split(os.path.abspath(main_exe))[0]
-    nicedir = re.sub(r':', "_", nicedir)
+    nicedir = re.sub(r':', "_", path.exedir())
     if rhost == '-':
         rhost = None
     if not rhost: