From: Gabriel Filion Date: Mon, 16 Aug 2010 01:29:34 +0000 (-0400) Subject: lib/bup/ssh: Add docstrings X-Git-Tag: bup-0.17~1 X-Git-Url: https://arthur.barton.de/gitweb/?a=commitdiff_plain;h=80937f02ed8b2e5a5763d38018eca859db503328;p=bup.git lib/bup/ssh: Add docstrings 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 --- diff --git a/lib/bup/ssh.py b/lib/bup/ssh.py index cefa543..99053ff 100644 --- a/lib/bup/ssh.py +++ b/lib/bup/ssh.py @@ -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]