source: TI05-delivery/trunk/test/runclient.py @ 1246

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/trunk/test/runclient.py@1246
Revision 1246, 636 bytes checked in by spascoe, 13 years ago (diff)

bbftpc.run() has been split into run(), docommand() and close().
Multiple commands per connection should now be possible.

  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2"""
3This script runs the bbftp client using the python-bbftp client wrapper.  We need this
4to test client-server interactions without importing both delivery.bbftpd and delivery.bbftpc
5into the interpreter.
6"""
7
8import os, sys
9from glob import glob
10
11HOME = os.path.abspath(os.getenv('NDG_DELIVERY_HOME', os.curdir))
12BUILDDIR = glob('%s/build/lib.*' % HOME)[0]
13sys.path.append(BUILDDIR)
14
15import delivery.bbftpc as BC
16
17# Extract the command (-e) since bbftpc doesn't use it any more
18args = sys.argv[1:]
19ei = args.index('-e')
20cmd = args[ei+1]
21args = args[:ei] + args[ei+2:]
22
23BC.run(args)
24BC.docommand(cmd)
25BC.close()
Note: See TracBrowser for help on using the repository browser.