[tahoe-lafs-trac-stream] [Tahoe-LAFS] #2825: rewrite CLI commands to use treq or twisted.web, not httplib
Tahoe-LAFS
trac at tahoe-lafs.org
Thu Sep 8 19:06:34 UTC 2016
#2825: rewrite CLI commands to use treq or twisted.web, not httplib
-------------------------------+---------------------------
Reporter: warner | Owner:
Type: task | Status: new
Priority: normal | Milestone: undecided
Component: code-frontend-cli | Version: 1.11.0
Keywords: | Launchpad Bug:
-------------------------------+---------------------------
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`.
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2825>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list