Skip to content

Commit

Permalink
run black
Browse files Browse the repository at this point in the history
  • Loading branch information
ItayTheDar committed Apr 15, 2024
1 parent 36e9907 commit ab6b059
Show file tree
Hide file tree
Showing 23 changed files with 19 additions and 38 deletions.
1 change: 0 additions & 1 deletion examples/BlankApp/src/app_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

@Controller("/")
class AppController:

def __init__(self, service: AppService):
self.service = service

Expand Down
1 change: 0 additions & 1 deletion examples/BlankApp/src/example/example_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

@Controller("example")
class ExampleController:

def __init__(self, service: ExampleService):
self.service = service

Expand Down
1 change: 0 additions & 1 deletion examples/BlankApp/src/product/product_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

@Controller("product")
class ProductController:

def __init__(self, service: ProductService):
self.service = service

Expand Down
1 change: 0 additions & 1 deletion examples/BlankApp/src/user/user_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

@Controller("user")
class UserController:

def __init__(self, service: UserService):
self.service = service

Expand Down
1 change: 0 additions & 1 deletion examples/MongoApp/src/app_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

@Controller("/")
class AppController:

def __init__(self, service: AppService):
self.service = service

Expand Down
1 change: 0 additions & 1 deletion examples/MongoApp/src/example/example_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

@Controller("example")
class ExampleController:

def __init__(self, service: ExampleService):
self.service = service

Expand Down
1 change: 0 additions & 1 deletion examples/MongoApp/src/example/example_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

@Injectable
class ExampleService:

@db_request_handler
async def add_example(self, example: Example):
new_example = ExampleEntity(**example.dict())
Expand Down
1 change: 0 additions & 1 deletion examples/MongoApp/src/product/product_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

@Controller("product")
class ProductController:

def __init__(self, service: ProductService):
self.service = service

Expand Down
1 change: 0 additions & 1 deletion examples/MongoApp/src/product/product_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

@Injectable
class ProductService:

@db_request_handler
async def add_product(self, product: Product):
new_product = ProductEntity(**product.dict())
Expand Down
1 change: 0 additions & 1 deletion examples/MongoApp/src/user/user_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

@Controller("user")
class UserController:

def __init__(self, service: UserService):
self.service = service

Expand Down
1 change: 0 additions & 1 deletion examples/MongoApp/src/user/user_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

@Injectable
class UserService:

@db_request_handler
async def add_user(self, user: User):
new_user = UserEntity(**user.dict())
Expand Down
1 change: 0 additions & 1 deletion examples/OrmAsyncApp/src/app_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

@Controller("/")
class AppController:

def __init__(self, service: AppService):
self.service = service

Expand Down
1 change: 0 additions & 1 deletion examples/OrmAsyncApp/src/example/example_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

@Controller("example")
class ExampleController:

def __init__(self, service: ExampleService):
self.service = service

Expand Down
1 change: 0 additions & 1 deletion examples/OrmAsyncApp/src/product/product_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

@Controller("product")
class ProductController:

def __init__(self, service: ProductService):
self.service = service

Expand Down
1 change: 0 additions & 1 deletion examples/OrmAsyncApp/src/user/user_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

@Controller("user")
class UserController:

def __init__(self, service: UserService):
self.service = service

Expand Down
1 change: 0 additions & 1 deletion examples/OrmSyncApp/src/app_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

@Controller("/")
class AppController:

def __init__(self, service: AppService):
self.service = service

Expand Down
1 change: 0 additions & 1 deletion examples/OrmSyncApp/src/example/example_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

@Controller("example")
class ExampleController:

def __init__(self, service: ExampleService):
self.service = service

Expand Down
1 change: 0 additions & 1 deletion examples/OrmSyncApp/src/product/product_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

@Controller("product")
class ProductController:

def __init__(self, service: ProductService):
self.service = service

Expand Down
1 change: 0 additions & 1 deletion examples/OrmSyncApp/src/user/user_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

@Controller("user")
class UserController:

def __init__(self, service: UserService):
self.service = service

Expand Down
30 changes: 15 additions & 15 deletions nest/core/decorators/http_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,26 @@ def decorator(func):


# Decorator for defining a GET route with an optional path
Get: Callable[[Union[str, List[str]]], Callable[..., Any]] = (
lambda path="/", **kwargs: route("GET", path, **kwargs)
)
Get: Callable[
[Union[str, List[str]]], Callable[..., Any]
] = lambda path="/", **kwargs: route("GET", path, **kwargs)

# Decorator for defining a POST route with an optional path
Post: Callable[[Union[str, List[str]]], Callable[..., Any]] = (
lambda path="/", **kwargs: route("POST", path, **kwargs)
)
Post: Callable[
[Union[str, List[str]]], Callable[..., Any]
] = lambda path="/", **kwargs: route("POST", path, **kwargs)

# Decorator for defining a DELETE route with an optional path
Delete: Callable[[Union[str, List[str]]], Callable[..., Any]] = (
lambda path="/", **kwargs: route("DELETE", path, **kwargs)
)
Delete: Callable[
[Union[str, List[str]]], Callable[..., Any]
] = lambda path="/", **kwargs: route("DELETE", path, **kwargs)

# Decorator for defining a PUT route with an optional path
Put: Callable[[Union[str, List[str]]], Callable[..., Any]] = (
lambda path="/", **kwargs: route("PUT", path, **kwargs)
)
Put: Callable[
[Union[str, List[str]]], Callable[..., Any]
] = lambda path="/", **kwargs: route("PUT", path, **kwargs)

# Decorator for defining a PATCH route with an optional path
Patch: Callable[[Union[str, List[str]]], Callable[..., Any]] = (
lambda path="/", **kwargs: route("PATCH", path, **kwargs)
)
Patch: Callable[
[Union[str, List[str]]], Callable[..., Any]
] = lambda path="/", **kwargs: route("PATCH", path, **kwargs)
3 changes: 2 additions & 1 deletion nest/core/decorators/injectable.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@


def Injectable(cls: str = None):
def __init__(self, *args, **kwargs): ...
def __init__(self, *args, **kwargs):
...

if "__init__" in cls.__dict__:
pass
Expand Down
1 change: 0 additions & 1 deletion tests/test_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def get_message(self):

@Controller("test")
class TestController:

def __init__(self, test_service: TestService):
self.test_service = test_service

Expand Down
4 changes: 2 additions & 2 deletions tests/test_core/test_decorators/test_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

@Controller(prefix="api/v1/user", tag="test")
class TestController:

def __init__(self): ...
def __init__(self):
...

@Get("/get_all_users")
def get_endpoint(self):
Expand Down

0 comments on commit ab6b059

Please sign in to comment.