Commit Graph

750 Commits

Author SHA1 Message Date
Sajith Sasidharan
92f6e4bfe5 Use explicit None-check on self.storage 2020-07-09 16:05:30 -04:00
Sajith Sasidharan
affe10b3e9 Return result from renderHTTP
Bogus renderHTTP, but test failures are now down to three. We just
need to handle requests for JSON now.
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
6b5e530cb3 Add a docstring 2020-07-09 16:05:30 -04:00
Sajith Sasidharan
abb8834be1 Rename function for clarity 2020-07-09 16:05:30 -04:00
Sajith Sasidharan
e67fa7cd95 Add docstrings to StorageStatusElement 2020-07-09 16:05:30 -04:00
Sajith Sasidharan
62a997ce20 Use parentheses in import statement 2020-07-09 16:05:30 -04:00
Sajith Sasidharan
1be736e4d1 Fix test_storage.WebStatus.test_no_server failure 2020-07-09 16:05:30 -04:00
Sajith Sasidharan
8dd4029428 Use <t:transparent /> within table cells 2020-07-09 16:05:30 -04:00
Sajith Sasidharan
6ccb9d29cb Use render_space methods to render space 2020-07-09 16:05:30 -04:00
Sajith Sasidharan
dbc6b2afa0 Drop unused ctx argument from render_space methods 2020-07-09 16:05:30 -04:00
Sajith Sasidharan
d5af7c0d2e Refactor so that test_util pass 2020-07-09 16:05:30 -04:00
Sajith Sasidharan
923219e54a Use right syntax for twisted.web.template tags 2020-07-09 16:05:29 -04:00
Sajith Sasidharan
42c3e276a3 Check storage server status before using it 2020-07-09 16:05:29 -04:00
Sajith Sasidharan
d1f17e1019 Second version of renderSynchronously 2020-07-09 16:05:29 -04:00
Sajith Sasidharan
805b880c2e Add missing flattenString import 2020-07-09 16:05:29 -04:00
Sajith Sasidharan
75488c4aff Add StorageStatus::renderSynchronously
Related to ticket:3247

test_storage.py wants a `StorageStatus::renderSynchronously()` method
and a `StorageStatus::renderHTTP()` method.  Let us begin with the
goofy first-cut.

Both these methods are not only wrong, but they will also not please
the test suite.  However error messages produced in CI can be shared,
and that way I can hopefully get unstuck.
2020-07-09 16:05:29 -04:00
Sajith Sasidharan
aad3557d2b Use twisted.web.template in web/storage.py
Related to ticket:3247.  Nevow usage has been removed, and generated
page looks the same as its former self, but tests are failing because
test_storage.py assumes that we're using nevow.
2020-07-09 16:05:29 -04:00
Sajith Sasidharan
b956d9a58c Decode name before null check
Make the diff against master a tad bit smaller.
2020-07-09 16:05:29 -04:00
Sajith Sasidharan
fccc331671 Make "Refresh" link work
This seems to be a subtle difference from nevow: with `href="."`,
rendered link target will be `/uri/`, so clicking "Refresh" will
result in an error message like so: "GET /uri requires uri=".

With `href=""`, the rendered link target will be `/uri/URI:...`, which
is what we need.
2020-07-09 16:05:29 -04:00
Sajith Sasidharan
378b20c51a Reject trailing empty path piece in URIs 2020-07-09 16:05:29 -04:00
Sajith Sasidharan
d3d0d02855 Reject URIs that contain empty segments 2020-07-09 16:05:29 -04:00
Sajith Sasidharan
5892eae580 Render self in DirectoryNodeHandler.getChild()
We need self.render_POST() etc. to be invoked when we have a request
such as "POST /uri/URI:DIR:..."; throwing an error here is probably
not the right thing to do.
2020-07-09 16:05:29 -04:00
Sajith Sasidharan
4dd6c86950 Use twisted web directives in web.operations.ReloadMixin 2020-07-09 16:05:28 -04:00
Sajith Sasidharan
54248f334e Use WebError, not RuntimeError, to indicate error
Several problems with using RuntimeError to signal error here:

- It dumps a rather unhelpful webpage at the user.
- The exception backtrace on Tahoe console is not quite necessary here.
- It really is not a runtime error: it is just an expected failure.
- But mainly, testing for RuntimeError is harder.
2020-07-09 14:35:14 -04:00
Sajith Sasidharan
f9e864c51c Use simpler syntax to update map 2020-06-24 08:15:18 -04:00
Sajith Sasidharan
d3f43d31d9 Remove unused import 2020-05-23 06:17:06 -04:00
Sajith Sasidharan
93d015e468 Document status.Status 2020-05-22 22:24:09 -04:00
Sajith Sasidharan
a6e32135e8 Update status page child route handler and table renderers
Drop nevow-isms and use twisted.web's way of doing things.
2020-05-22 22:15:45 -04:00
Sajith Sasidharan
3357f4c5ce Make Status a MultiFormatResource 2020-05-22 22:12:22 -04:00
Sajith Sasidharan
81dc63b511 Use twisted template tags in status page template 2020-05-22 22:12:22 -04:00
Sajith Sasidharan
9520ad71eb Rearrange imports 2020-05-22 21:24:21 -04:00
Sajith Sasidharan
538503c0f8
Merge pull request #717 from sajith/3289.status-publish-nevow-to-twisted-web
Replace nevow with twisted.web.template in status.PublishStatusPage

Fixes: ticket:3289
2020-05-14 10:09:57 -04:00
Sajith Sasidharan
78c214b7ff
Merge pull request #716 from sajith/3290.status-retrieve-nevow-to-twisted-web
Replace nevow with twisted.web.template in status.RetrieveStatusPage

Fixes: ticket:3290
2020-05-13 19:39:23 -04:00
Sajith Sasidharan
79a44eac33 Correct docstring to ":param <type> <name>" format 2020-05-13 19:29:41 -04:00
Sajith Sasidharan
9d5d338993 Correct docstring to ":param <type> <name>" format 2020-05-13 19:04:10 -04:00
Sajith Sasidharan
d87dfaf5a0
Merge pull request #714 from sajith/3291.status-mapupdate-nevow-to-twisted-web
Replace nevow with twisted.web.template in status.MapupdatePage

Fixes: ticket:3291
2020-05-13 18:22:16 -04:00
Sajith Sasidharan
ebe80221d5 Add missing "param:" to init method docstring 2020-05-13 17:45:08 -04:00
Sajith Sasidharan
2e0e210c14 Make PublishStatusPage comment a docstring 2020-05-13 17:43:55 -04:00
Sajith Sasidharan
5aa0dd4085 Rename a variable for readability
Noticed in code review: `l` can be confused with `1` for many
typefaces.
2020-05-13 17:12:08 -04:00
Sajith Sasidharan
812f03934a Add missing "param:" to docstring 2020-05-13 17:09:53 -04:00
Sajith Sasidharan
4af2e4b4df Drop an unbalanced quote 2020-05-13 17:08:26 -04:00
Sajith Sasidharan
62760c0997 Make RetrieveStatusPage comment a docstring 2020-05-13 17:07:09 -04:00
Sajith Sasidharan
8e17d203cf Add missing "param:" to docstring 2020-05-13 16:59:52 -04:00
Sajith Sasidharan
c18488872c Make comment on MapupdateStatusPage a docstring 2020-05-13 16:54:39 -04:00
Sajith Sasidharan
3fad9a127c Remove web.common.RenderMixin
Fixes: ticket:3308
2020-05-12 07:40:22 -04:00
Sajith Sasidharan
0ae045ea16 Add comments to PublishStatusPage 2020-05-11 12:47:48 -04:00
Sajith Sasidharan
9e200fc014 Render publish problems only when there are problems 2020-05-11 11:43:04 -04:00
Sajith Sasidharan
0fba615afb Remove RateAndTimeMixin from PublishStatusPage 2020-05-11 11:43:04 -04:00
Sajith Sasidharan
fdf6449ba8 Use MultiFormatResource to implement PublishStatusPage 2020-05-11 11:43:04 -04:00
Sajith Sasidharan
89c4210090 Use twisted tags in publish status template page 2020-05-11 11:43:01 -04:00