diff options
author | Avery Pennarun <apenwarr@gmail.com> | 2011-01-25 21:07:01 -0800 |
---|---|---|
committer | Avery Pennarun <apenwarr@gmail.com> | 2011-01-25 21:07:39 -0800 |
commit | 8fde1155da2444e9614484385a5bc30d6feadd25 (patch) | |
tree | 96d33097a0db7af7b615de9ae592684ac24ea8ce /ssh.py | |
parent | fdb7c9b9953deead6dcaff5a2aa13a581180fabe (diff) |
Implement the optional fullness checking a bit more like I like it.
Looks like it worked before, but personal preference is a killer.
The new name is "--no-latency-control".
Diffstat (limited to 'ssh.py')
-rw-r--r-- | ssh.py | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -1,6 +1,6 @@ import sys, os, re, socket, zlib import compat.ssubprocess as ssubprocess -import helpers, ssnet +import helpers from helpers import * @@ -14,14 +14,16 @@ def readfile(name): raise Exception("can't find file %r in any of %r" % (name, path)) -def empackage(z, filename): +def empackage(z, filename, data=None): (path,basename) = os.path.split(filename) - content = z.compress(readfile(filename)) + if not data: + data = readfile(filename) + content = z.compress(data) content += z.flush(zlib.Z_SYNC_FLUSH) - return '%s\n%d\n%s' % (basename,len(content), content) + return '%s\n%d\n%s' % (basename, len(content), content) -def connect(ssh_cmd, rhostport, python, stderr): +def connect(ssh_cmd, rhostport, python, stderr, options): main_exe = sys.argv[0] portl = [] @@ -52,7 +54,9 @@ def connect(ssh_cmd, rhostport, python, stderr): z = zlib.compressobj(1) content = readfile('assembler.py') - content2 = (empackage(z, 'helpers.py') + + optdata = ''.join("%s=%r\n" % (k,v) for (k,v) in options.items()) + content2 = (empackage(z, 'cmdline_options.py', optdata) + + empackage(z, 'helpers.py') + empackage(z, 'compat/ssubprocess.py') + empackage(z, 'ssnet.py') + empackage(z, 'hostwatch.py') + @@ -63,9 +67,8 @@ def connect(ssh_cmd, rhostport, python, stderr): import sys; skip_imports=1; verbosity=%d; - no_fullness0=%d; exec compile(sys.stdin.read(%d), "assembler.py", "exec") - """ % (helpers.verbose or 0, ssnet.no_fullness or 0, len(content)) + """ % (helpers.verbose or 0, len(content)) pyscript = re.sub(r'\s+', ' ', pyscript.strip()) |