black line length 120
This commit is contained in:
parent
a1644e3652
commit
8af57254ae
12
app/close.py
12
app/close.py
@ -15,20 +15,14 @@ class ExitCommand(Command):
|
|||||||
)
|
)
|
||||||
self.sender: str = ""
|
self.sender: str = ""
|
||||||
|
|
||||||
def pre_execute(
|
def pre_execute(self, message, attachment_actions, activity) -> None: # pylint: disable=unused-argument
|
||||||
self, message, attachment_actions, activity
|
|
||||||
) -> None: # pylint: disable=unused-argument
|
|
||||||
"""Pre-execution logic for the exit command."""
|
"""Pre-execution logic for the exit command."""
|
||||||
return
|
return
|
||||||
|
|
||||||
def execute(
|
def execute(self, message, attachment_actions, activity) -> None: # pylint: disable=unused-argument
|
||||||
self, message, attachment_actions, activity
|
|
||||||
) -> None: # pylint: disable=unused-argument
|
|
||||||
"""Execute the exit command."""
|
"""Execute the exit command."""
|
||||||
return
|
return
|
||||||
|
|
||||||
def post_execute(
|
def post_execute(self, message, attachment_actions, activity) -> None: # pylint: disable=unused-argument
|
||||||
self, message, attachment_actions, activity
|
|
||||||
) -> None: # pylint: disable=unused-argument
|
|
||||||
"""Post-execution logic for the exit command."""
|
"""Post-execution logic for the exit command."""
|
||||||
return
|
return
|
||||||
|
24
app/meme.py
24
app/meme.py
@ -32,15 +32,11 @@ class MakeMemeCommand(Command):
|
|||||||
delete_previous_message=True,
|
delete_previous_message=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
def pre_execute(
|
def pre_execute(self, message, attachment_actions, activity) -> None: # pylint: disable=unused-argument
|
||||||
self, message, attachment_actions, activity
|
|
||||||
) -> None: # pylint: disable=unused-argument
|
|
||||||
"""Pre-execution logic for the MakeMemeCommand."""
|
"""Pre-execution logic for the MakeMemeCommand."""
|
||||||
return
|
return
|
||||||
|
|
||||||
def execute(
|
def execute(self, message, attachment_actions, activity) -> Response: # pylint: disable=unused-argument
|
||||||
self, message, attachment_actions, activity
|
|
||||||
) -> Response: # pylint: disable=unused-argument
|
|
||||||
"""Execute the MakeMemeCommand and return an adaptive card."""
|
"""Execute the MakeMemeCommand and return an adaptive card."""
|
||||||
card_body: list = [
|
card_body: list = [
|
||||||
ColumnSet(
|
ColumnSet(
|
||||||
@ -77,9 +73,7 @@ class MakeMemeCommand(Command):
|
|||||||
Choices(
|
Choices(
|
||||||
id="meme_type",
|
id="meme_type",
|
||||||
isMultiSelect=False,
|
isMultiSelect=False,
|
||||||
choices=[
|
choices=[Choice(title=x["name"], value=x["choiceval"]) for x in TEMPLATES],
|
||||||
Choice(title=x["name"], value=x["choiceval"]) for x in TEMPLATES
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
Text(id="text_top", placeholder="Top Text", maxLength=100),
|
Text(id="text_top", placeholder="Top Text", maxLength=100),
|
||||||
Text(
|
Text(
|
||||||
@ -122,9 +116,7 @@ class MakeMemeCallback(Command):
|
|||||||
self.meme: str = ""
|
self.meme: str = ""
|
||||||
self.meme_filename: str = ""
|
self.meme_filename: str = ""
|
||||||
|
|
||||||
def pre_execute(
|
def pre_execute(self, message, attachment_actions, activity) -> str: # pylint: disable=unused-argument
|
||||||
self, message, attachment_actions, activity
|
|
||||||
) -> str: # pylint: disable=unused-argument
|
|
||||||
"""Pre-execution logic for the MakeMemeCallback."""
|
"""Pre-execution logic for the MakeMemeCallback."""
|
||||||
self.meme: str = attachment_actions.inputs.get("meme_type")
|
self.meme: str = attachment_actions.inputs.get("meme_type")
|
||||||
self.text_top: str = attachment_actions.inputs.get("text_top")
|
self.text_top: str = attachment_actions.inputs.get("text_top")
|
||||||
@ -139,9 +131,7 @@ class MakeMemeCallback(Command):
|
|||||||
|
|
||||||
return "Generating your meme..."
|
return "Generating your meme..."
|
||||||
|
|
||||||
def execute(
|
def execute(self, message, attachment_actions, activity) -> Response | None: # pylint: disable=unused-argument
|
||||||
self, message, attachment_actions, activity
|
|
||||||
) -> Response | None: # pylint: disable=unused-argument
|
|
||||||
"""Execute the MakeMemeCallback and return a response with the meme image."""
|
"""Execute the MakeMemeCallback and return a response with the meme image."""
|
||||||
if self.error:
|
if self.error:
|
||||||
return None
|
return None
|
||||||
@ -156,8 +146,6 @@ class MakeMemeCallback(Command):
|
|||||||
)
|
)
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def post_execute(
|
def post_execute(self, message, attachment_actions, activity) -> None: # pylint: disable=unused-argument
|
||||||
self, message, attachment_actions, activity
|
|
||||||
) -> None: # pylint: disable=unused-argument
|
|
||||||
"""Post-execution logic for the MakeMemeCallback."""
|
"""Post-execution logic for the MakeMemeCallback."""
|
||||||
return
|
return
|
||||||
|
@ -34,4 +34,4 @@ requires = ["pdm-backend"]
|
|||||||
build-backend = "pdm.backend"
|
build-backend = "pdm.backend"
|
||||||
|
|
||||||
[tool.black]
|
[tool.black]
|
||||||
line-length = 101
|
line-length = 120
|
||||||
|
@ -29,8 +29,4 @@ def test_error_false() -> None:
|
|||||||
callback.text_top = "TEST"
|
callback.text_top = "TEST"
|
||||||
callback.text_bottom = "TEST"
|
callback.text_bottom = "TEST"
|
||||||
result: Response = callback.execute(None, None, {"target": {"globalId": "TEST"}})
|
result: Response = callback.execute(None, None, {"target": {"globalId": "TEST"}})
|
||||||
assert (
|
assert isinstance(result, Response) and result.roomId == "TEST" and result.files[0] == callback.meme_filename
|
||||||
isinstance(result, Response)
|
|
||||||
and result.roomId == "TEST"
|
|
||||||
and result.files[0] == callback.meme_filename
|
|
||||||
)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user