#2825 new task

rewrite CLI commands to use treq or twisted.web, not httplib

Reported by: warner Owned by:
Priority: normal Milestone: undecided
Component: code-frontend-cli Version: 1.11.0
Keywords: Cc:
Launchpad Bug:

Description

For various reasons, when we first wrote the CLI side of the WAPI frontend (tools like tahoe put and tahoe ls), we decided to go low-tech, and use stdlib httplib. I think I was intending these scripts to serve as examples for folks who wanted to incorporate Tahoe client-side API usage into their own apps, so I didn't want to burden them with Twisted concepts.

But the blocking behavior of those scripts makes it a hassle to exercise them in our trial-based test framework (we have to use deferToThread() each time). And httplib is a lousy choice for an educational tool: if we rewrote them today and really wanted blocking/sync style, we'd use requests.

So I'm thinking that we should rewrite those tools with treq, the Deferred-style variant of requests (which uses twisted.web under the hood). Then we could remove the deferToThread calls from e.g. test.cli.test_cli.CLITestMixin.

Change History (0)

Note: See TracTickets for help on using tickets.