a first crack at the "put" command-line

There are actually two versions in this patch, one of which requires twisted.web2 and the other of which uses the Python standard library's socket module.  The socketish one doesn't know when the web server is done so it hangs after doing its thing.  (Oh -- maybe I should add an HTTP header asking the web server to close the connection when finished.)  The web2ish one works better in that respect.  Neither of them handle error responses from the server very well yet.

After lunch I intend to finish the socketish one.

To try one, mv src/allmydata/scripts/tahoe_put-{socketish,web2ish}.py src/allmydata/scripts/tahoe_put.py .

If you want to try the web2ish one, and you can't find a web2 package to install, you can get one from:

http://allmydata.org/~zooko/repos/twistedweb2snarf/
This commit is contained in:
Zooko O'Whielacronx
2007-08-16 12:15:38 -07:00
parent 8e12cc83df
commit 6c4fb6fd93
4 changed files with 225 additions and 9 deletions

View File

@ -3,16 +3,11 @@ import sys
from cStringIO import StringIO
from twisted.python import usage
from allmydata.scripts import debug, create_node, startstop_node, cli
import debug, create_node, startstop_node, cli
class Options(usage.Options):
class Options(cli.OptionsMixin):
synopsis = "Usage: allmydata <command> [command options]"
optFlags = [
["quiet", "q", "Operate silently."],
["version", "V", "Display version numbers and exit."],
]
subCommands = []
subCommands += create_node.subCommands
subCommands += startstop_node.subCommands