]> arthur.barton.de Git - bup.git/commitdiff
lib/bup/ssh: Add docstrings
authorGabriel Filion <lelutin@gmail.com>
Mon, 16 Aug 2010 01:29:34 +0000 (21:29 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Sun, 22 Aug 2010 07:16:30 +0000 (00:16 -0700)
Document the code with doctrings.

Also add an "import sys" line since it is used by sys.argv[0] on line 6.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
lib/bup/ssh.py

index cefa54385307ed290dd55c856c5fb6d50dcf90e0..99053ffdd523380070aada6fc0dee45847aaafb8 100644 (file)
@@ -1,7 +1,16 @@
-import os, re, subprocess
+"""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
 
+
 def connect(rhost, 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]