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
51d6307b45
Fail better when timings data isn't available
2020-07-08 13:08:35 -04:00
Sajith Sasidharan
81216f18bf
Remove some whitespace
2020-07-08 10:15:33 -04:00
Sajith Sasidharan
7757756a41
Use correct tag type
2020-07-07 20:45:30 -04:00
Sajith Sasidharan
0c4d24a2ac
Avoid use of deferred within an Element
...
This causes the final HTML to be rendered funny, with a bunch of
"<Deferred current result=...>", which is clearly not what we want.
2020-07-07 20:24:56 -04:00
Sajith Sasidharan
7877d8a5cc
Use an accessor
2020-07-07 19:55:14 -04:00
Sajith Sasidharan
e6eb387707
Remove status.RateAndTimeMixin
...
Both UploadResultsRenderer and DownloadResultsRenderer do not use
RateAndTimeMixin anymore: safe to remove it now.
Tests for methods formerly in RateAndTimeMixin have been moved to
test.web.test_util: specifically test_abbreviate_rate() and
test_abbreviate_time().
2020-07-06 17:11:30 -04:00
Sajith Sasidharan
4a47e8311f
Merge 'origin/master' into 3288.status-download-nevow-to-twisted-web
2020-07-06 16:38:23 -04:00
Sajith Sasidharan
25f5e659fc
Merge pull request #721 from sajith/3287.status-upload-nevow-to-twisted-web
...
Replace nevow with twisted.web.template in status.UploadStatusPage
Fixes: ticket:3287
2020-07-06 16:20:40 -04:00
Sajith Sasidharan
61aef4caef
Merge pull request #690 from sajith/3247.storage-py-neovw-to-twt
...
Use twisted.web.template in web/storage.py
Fixes: ticket:3247
2020-07-06 16:18:34 -04:00
Sajith Sasidharan
f9e864c51c
Use simpler syntax to update map
2020-06-24 08:15:18 -04:00
Sajith Sasidharan
88d3fa7415
Remove now-unnecessary UploadResultsPage.render_UPLOAD
2020-06-23 21:54:23 -04:00
Sajith Sasidharan
dfbb8e7743
Make UploadResultsPage a Resource
2020-06-23 21:53:39 -04:00
Sajith Sasidharan
6ab7f26faf
Make UploadStatusPage a Resource
2020-06-23 21:28:31 -04:00
Sajith Sasidharan
00e852c465
Make DownloadStatus an object
...
PythonTwoRegressions.test_new_style_classes would be unhappy without
this.
2020-06-23 20:54:49 -04:00
Sajith Sasidharan
36ecd8f384
Use render_GET()
...
Implementing `render_METHOD()` is preferred over overriding render()
2020-06-23 20:54:49 -04:00
Sajith Sasidharan
b14c0a0495
Make DownloadStatusPage a Resource
...
No need of this being a MultiFormatResource, because it renders just
HTML.
2020-06-23 20:54:49 -04:00
Sajith Sasidharan
982ad8942e
Comment about nevow.url usage in web.operations.OphandleTable
2020-06-18 18:30:18 -04:00
Sajith Sasidharan
2d2e8a5872
Add comments to web.operations.OphandleTable
2020-06-18 18:29:39 -04:00
Sajith Sasidharan
bbee23b493
Rename a parameter for clarity
...
"context" is nevow terminology, whereas these are really requests.
2020-06-18 18:29:39 -04:00
Sajith Sasidharan
5ec78641db
Make web.operations.OphandleTable a twisted web Resource
2020-06-18 18:29:27 -04:00
Sajith Sasidharan
6f8af688dd
Rearrange imports
2020-06-18 18:01:18 -04:00
Sajith Sasidharan
e121cc0a84
Use the right names
...
Missed this in testing because this code was not reached in testing.
2020-06-17 22:09:50 -04:00
Sajith Sasidharan
4f213e93be
Remove an unused variable
2020-06-17 22:04:08 -04:00
Sajith Sasidharan
0483fc91c1
Remove unused import
2020-06-17 22:04:08 -04:00
Sajith Sasidharan
c3440ce213
Use a helper to query monitor counters
2020-06-17 21:53:11 -04:00
Sajith Sasidharan
47f9147e16
Rename a class for consistency's sake
2020-06-17 21:46:40 -04:00
Sajith Sasidharan
fe1b0cb7ed
Rename class variables
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
22977352bb
Document parameters of ResultsRenderer classes
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
79be795566
Remove unused want_json()
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
23a51117d2
Rename r
to check_results
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
fae4f44404
Prefer req
to ctx
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
cdb3747470
Remove nevow imports
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
de99912641
Replace ctx
references with req
references
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
2e60408bf6
Wrap counters in <span> tags
...
Unless the rendered page contains strings of the form "Objects
Checked: <span>n</span>" etc, test_POST_DIRURL_deepcheck will not
pass.
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
33ddac879c
Remove unused code
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
8094b3144d
Use SlotsSequenceElement to render all objects
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
4e594b09bf
Use SlotsSequenceElement to render corrupt shares
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
46cb3b6bc3
Use SlotsSequenceElement to render servers with corrupt shares
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
c41bca24f5
Use SlotsSequenceElement to render deep check results problems
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
bbd6bde478
Use SlotsSequenceElement to render remaining corrupt shares
...
This was previously not implemented; leaving it as such.
2020-06-17 21:18:14 -04:00