-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add static helpers #2824
Add static helpers #2824
Conversation
def test_repr_static_def(): | ||
routes = web.RouteTableDef() | ||
|
||
routes.static('/prefix', '/path', name='name') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this method is intentionally not a decorator: static has no user-supported handler, only prefix
, path
and optional parameters. I'll document it properly.
The reason why url.static()
and routes.static
should exist is it is a part of configuration which very often is constant (safe to be done at module level). No need to add app.add_statiic()
shortcut.
app.router.add_static()
is redundant (but still exist and do all work internally).
app.add_subapp
is a different beast: it requires subapp
instance, that's why I don't want to add shourcuts for add_subapp
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, I see. Now it looks fine. On previous version there was a function right after and that looks like missed @ from decorator.
Codecov Report
@@ Coverage Diff @@
## master #2824 +/- ##
==========================================
+ Coverage 97.96% 97.97% +<.01%
==========================================
Files 39 39
Lines 7426 7445 +19
Branches 1305 1307 +2
==========================================
+ Hits 7275 7294 +19
Misses 48 48
Partials 103 103
Continue to review full report at Codecov.
|
Thanks @kxepal |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
Fixes #2795