From ee74110cffe09a0127aac68f5a29d06bf33ea7d8 Mon Sep 17 00:00:00 2001 From: chocolateboy Date: Fri, 3 Sep 2010 15:46:25 +0100 Subject: add option to allow the remote python binary's name/path to be specified --- ssh.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ssh.py') diff --git a/ssh.py b/ssh.py index 7a37c36..d790d4a 100644 --- a/ssh.py +++ b/ssh.py @@ -19,7 +19,7 @@ def empackage(z, filename): return '%s\n%d\n%s' % (filename,len(content), content) -def connect(rhostport): +def connect(rhostport, python): main_exe = sys.argv[0] l = (rhostport or '').split(':', 1) rhost = l[0] @@ -48,9 +48,9 @@ def connect(rhostport): if not rhost: - argv = ['python', '-c', pyscript] + argv = [python, '-c', pyscript] else: - argv = ['ssh'] + portl + [rhost, '--', "python -c '%s'" % pyscript] + argv = ['ssh'] + portl + [rhost, '--', "'%s' -c '%s'" % (python, pyscript)] (s1,s2) = socket.socketpair() def setup(): # runs in the child process -- cgit v1.2.3