Skip to content

Commit a193cee

Browse files
committed
Refactored Execution Context to HostContext and ExecutionContext.
1 parent 81d250a commit a193cee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+537
-295
lines changed

ellar/common/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from ellar.core.params.params import Param, ParamTypes
22
from ellar.core.routing import ModuleRouter
33

4-
from .decorators.base import set_meta
4+
from .decorators.base import set_metadata
55
from .decorators.command import command
66
from .decorators.controller import Controller
77
from .decorators.exception import exception_handler
@@ -16,8 +16,8 @@
1616
from .decorators.versioning import version
1717
from .routing import (
1818
Body,
19+
Context,
1920
Cookie,
20-
Ctx,
2121
File,
2222
Form,
2323
Header,
@@ -52,7 +52,7 @@
5252
"guards",
5353
"Param",
5454
"ParamTypes",
55-
"set_meta",
55+
"set_metadata",
5656
"Controller",
5757
"openapi_info",
5858
"version",
@@ -74,7 +74,7 @@
7474
"Path",
7575
"Query",
7676
"WsBody",
77-
"Ctx",
77+
"Context",
7878
"Provide",
7979
"Req",
8080
"Ws",

ellar/common/decorators/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .base import set_meta # noqa
1+
from .base import set_metadata # noqa
22
from .command import command # noqa
33
from .controller import Controller # noqa
44
from .exception import exception_handler # noqa

ellar/common/decorators/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
from ellar.reflect import reflect
66

77

8-
def set_meta(
8+
def set_metadata(
99
meta_key: t.Any,
1010
meta_value: t.Optional[t.Any] = NOT_SET,
1111
default_value: t.Any = None,
1212
) -> t.Callable:
1313
if meta_value is NOT_SET:
14-
return partial(set_meta, meta_key)
14+
return partial(set_metadata, meta_key)
1515

1616
def _decorator(target: t.Union[t.Callable, t.Any]) -> t.Union[t.Callable, t.Any]:
1717
reflect.define_metadata(meta_key, meta_value, target, default_value)

ellar/common/decorators/file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
)
1111
from ellar.shortcuts import fail_silently
1212

13-
from .base import set_meta
13+
from .base import set_metadata as set_meta
1414

1515

1616
def file(media_type: t.Optional[str] = NOT_SET, streaming: bool = False) -> t.Callable:

ellar/common/decorators/guards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from ellar.constants import GUARDS_KEY
44

5-
from .base import set_meta
5+
from .base import set_metadata as set_meta
66

77
if t.TYPE_CHECKING: # pragma: no cover
88
from ellar.core.guard import GuardCanActivate

ellar/common/decorators/html.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from ellar.shortcuts import fail_silently
1717
from ellar.types import TemplateFilterCallable, TemplateGlobalCallable
1818

19-
from .base import set_meta
19+
from .base import set_metadata as set_meta
2020

2121

2222
class RenderDecoratorException(Exception):

ellar/common/decorators/openapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from ellar.compatible import AttributeDict
44
from ellar.constants import OPENAPI_KEY
55

6-
from .base import set_meta
6+
from .base import set_metadata as set_meta
77

88

99
def openapi_info(

ellar/common/decorators/serializer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from ellar.constants import SERIALIZER_FILTER_KEY
44

5-
from .base import set_meta
5+
from .base import set_metadata as set_meta
66

77

88
def serializer_filter(

ellar/common/decorators/versioning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from ellar.constants import VERSIONING_KEY
44

5-
from .base import set_meta
5+
from .base import set_metadata as set_meta
66

77

88
def version(*_version: str) -> t.Callable:

ellar/common/routing/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
from .params import (
66
Body,
7+
Context,
78
Cookie,
8-
Ctx,
99
File,
1010
Form,
1111
Header,
@@ -39,7 +39,7 @@
3939
ws_route = _route_definitions.ws_route
4040

4141
__all__ = [
42-
"Ctx",
42+
"Context",
4343
"Provide",
4444
"Req",
4545
"Ws",

0 commit comments

Comments
 (0)