mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-07-04 15:43:02 +02:00
fix(lint): fix G004 and PTH123 violations across codebase
- Convert f-string logging to % style (G004) - Convert open() to Path.open() (PTH123) - Remove G004 and PTH123 from global ignores in pyproject.toml
This commit is contained in:
parent
eaa1700265
commit
d809beeca7
@ -632,7 +632,7 @@ class ScreenLocker:
|
||||
return False
|
||||
|
||||
try:
|
||||
with open(self.log_file) as f:
|
||||
with self.log_file.open() as f:
|
||||
logs = json.load(f)
|
||||
except (OSError, json.JSONDecodeError):
|
||||
return False
|
||||
@ -646,7 +646,7 @@ class ScreenLocker:
|
||||
logs = {}
|
||||
if self.log_file.exists():
|
||||
try:
|
||||
with open(self.log_file) as f:
|
||||
with self.log_file.open() as f:
|
||||
logs = json.load(f)
|
||||
except (OSError, json.JSONDecodeError):
|
||||
logs = {}
|
||||
@ -660,10 +660,10 @@ class ScreenLocker:
|
||||
|
||||
# Save updated logs
|
||||
try:
|
||||
with open(self.log_file, "w") as f:
|
||||
with self.log_file.open("w") as f:
|
||||
json.dump(logs, f, indent=2)
|
||||
except OSError as e:
|
||||
_logger.warning(f"Could not save workout log: {e}")
|
||||
_logger.warning("Could not save workout log: %s", e)
|
||||
|
||||
def close(self) -> None:
|
||||
"""Close the application and exit."""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user