Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
nexy7574 committed Nov 9, 2023
1 parent ccefd09 commit 2165095
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/niobot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def version(no_colour: bool):
python_version_supported = False
else:
python_version_supported = True

nio_versions_raw = ""
for version in importlib.metadata.requires("nio-bot"):
if version.startswith("matrix-nio"):
Expand Down
4 changes: 1 addition & 3 deletions src/niobot/attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,9 +1042,7 @@ async def from_file(
if stream["codec_type"] == "video":
if stream["codec_name"].lower() not in SUPPORTED_VIDEO_CODECS or not stream[
"codec_name"
].startswith(
"pcm_"
): # usually, pcm is supported.
].startswith("pcm_"): # usually, pcm is supported.
warning = MediaCodecWarning(stream["codec_name"], *SUPPORTED_VIDEO_CODECS)
warnings.warn(warning)
height = stream["height"]
Expand Down
2 changes: 1 addition & 1 deletion src/niobot/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(
automatic_markdown_renderer: bool = True,
max_message_cache: int = 1000,
ignore_self: bool = True,
import_keys: typing.Tuple[os.PathLike, typing.Optional[str]] = None
import_keys: typing.Tuple[os.PathLike, typing.Optional[str]] = None,
):
if user_id == owner_id and ignore_self is True:
warnings.warn(
Expand Down
6 changes: 1 addition & 5 deletions src/niobot/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,7 @@ def autodetect_args(callback) -> list[Argument]:
for n, parameter in enumerate(inspect.signature(callback).parameters.values()):
# If it has a parent class and this is the first parameter, skip it.
if n == 0 and parameter.name == "self":
log.debug(
"Found 'self' parameter (%r) at position %d, skipping argument detection.",
parameter,
n
)
log.debug("Found 'self' parameter (%r) at position %d, skipping argument detection.", parameter, n)
continue

if parameter.name in ["ctx", "context"] or parameter.annotation is Context:
Expand Down

0 comments on commit 2165095

Please sign in to comment.