Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- id: check-merge-conflict
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.13
rev: v0.15.22
hooks:
- id: ruff-check
args:
Expand Down
4 changes: 2 additions & 2 deletions examples/async.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ async def main() -> None:
try:
signal = await worker.get_signal_quality_async()
print(f"Signal is at {signal['SignalPercent']:d}%")
except Exception as e: # noqa: BLE001
except Exception as e: # ruff:ignore[blind-except]
print(f"Exception reading signal: {e}")

await asyncio.sleep(10)

except Exception as e: # noqa: BLE001
except Exception as e: # ruff:ignore[blind-except]
print("Exception:")
print(e)

Expand Down
2 changes: 1 addition & 1 deletion examples/dummy_phone.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def print_all_sms(sms, folders) -> None:
def link_all_sms(sms, folders) -> None:
data = gammu.LinkSMS([[msg] for msg in sms])

for x in data: # noqa: PLR1702
for x in data: # ruff:ignore[too-many-nested-blocks]
v = gammu.DecodeSMS(x)

m = x[0]
Expand Down
2 changes: 1 addition & 1 deletion examples/filesystem_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
import gammu


def main() -> None: # noqa: PLR0912, PLR0915, C901
def main() -> None: # ruff:ignore[too-many-branches, too-many-statements, complex-structure]
parser = argparse.ArgumentParser(usage="usage: %(prog)s [options]")

parser.add_argument(
Expand Down
2 changes: 1 addition & 1 deletion examples/read_sms_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def main() -> None:

data = gammu.LinkSMS(messages)

for message in data: # noqa: PLR1702
for message in data: # ruff:ignore[too-many-nested-blocks]
decoded = gammu.DecodeSMS(message)

part = message[0]
Expand Down
4 changes: 2 additions & 2 deletions gammu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
#
"""Phone communication library - python wrapper for Gammu library."""

from gammu._gammu import * # noqa: F403
from gammu._gammu import * # ruff:ignore[undefined-local-with-import-star]

__version__ = "Gammu {}, python-gammu {}".format(*Version()) # noqa: F405
__version__ = "Gammu {}, python-gammu {}".format(*Version()) # ruff:ignore[undefined-local-with-import-star-usage]
2 changes: 1 addition & 1 deletion gammu/asyncworker.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _do_command(self, future, cmd, params, percentage=100) -> None:
error = gammu.ErrorNumbers[errcode]
self._callback(future, result, error, percentage)
# pylint: disable-next=broad-except
except Exception as exception: # noqa: BLE001
except Exception as exception: # ruff:ignore[blind-except]
self._callback(future, None, exception, percentage)
else:
self._callback(future, result, None, percentage)
Expand Down
2 changes: 1 addition & 1 deletion gammu/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
continue
_temp = __import__("gammu._gammu", globals(), locals(), [_name], 0)
locals()[_name] = getattr(_temp, _name)
__all__.append(_name) # noqa: PYI056
__all__.append(_name) # ruff:ignore[unsupported-method-call-on-all]

# Cleanup
del _name
Expand Down
2 changes: 1 addition & 1 deletion gammu/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def run(self) -> None:
# Read the device to catch possible incoming events
try:
self._pull_func(self._sm)
except Exception as ex: # noqa: BLE001
except Exception as ex: # ruff:ignore[blind-except]
self._callback("ReadDevice", None, ex, 0)

def kill(self) -> None:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import os
import platform
import subprocess # noqa: S404
import subprocess # ruff:ignore[suspicious-subprocess-import]
import sys
from pathlib import Path
from typing import cast
Expand Down Expand Up @@ -79,7 +79,7 @@ def lookup_path(self) -> Path | None:
def check_version(self) -> None:
if self.use_pkgconfig:
try:
subprocess.check_output( # noqa: S603
subprocess.check_output( # ruff:ignore[subprocess-without-shell-equals-true]
[
"pkg-config",
"--print-errors",
Expand Down
2 changes: 1 addition & 1 deletion test/test_dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def call_callback(self, state_machine, response, data) -> None:
assert data["Number"] == "+800123456"


class BasicDummyTest(DummyTest): # noqa: PLR0904
class BasicDummyTest(DummyTest): # ruff:ignore[too-many-public-methods]
def test_model(self) -> None:
state_machine = self.get_statemachine()
assert state_machine.GetModel()[1] == "Dummy"
Expand Down