black line length 120
All checks were successful
Enforce Conventional Commit PR Title / Validate PR Title (pull_request_target) Successful in 7s
CI / ci (pull_request) Successful in 1m15s

This commit is contained in:
Luke Tainton 2025-06-06 18:37:21 +01:00
parent a1644e3652
commit 8af57254ae
Signed by: luke
SSH Key Fingerprint: SHA256:D34npKT7UaiT/7gULqu7EPSLWWVAjTjXf4kKfJ/fQBo
4 changed files with 11 additions and 33 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
)