mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-21 01:12:23 +01: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
|
return False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(self.log_file) as f:
|
with self.log_file.open() as f:
|
||||||
logs = json.load(f)
|
logs = json.load(f)
|
||||||
except (OSError, json.JSONDecodeError):
|
except (OSError, json.JSONDecodeError):
|
||||||
return False
|
return False
|
||||||
@ -646,7 +646,7 @@ class ScreenLocker:
|
|||||||
logs = {}
|
logs = {}
|
||||||
if self.log_file.exists():
|
if self.log_file.exists():
|
||||||
try:
|
try:
|
||||||
with open(self.log_file) as f:
|
with self.log_file.open() as f:
|
||||||
logs = json.load(f)
|
logs = json.load(f)
|
||||||
except (OSError, json.JSONDecodeError):
|
except (OSError, json.JSONDecodeError):
|
||||||
logs = {}
|
logs = {}
|
||||||
@ -660,10 +660,10 @@ class ScreenLocker:
|
|||||||
|
|
||||||
# Save updated logs
|
# Save updated logs
|
||||||
try:
|
try:
|
||||||
with open(self.log_file, "w") as f:
|
with self.log_file.open("w") as f:
|
||||||
json.dump(logs, f, indent=2)
|
json.dump(logs, f, indent=2)
|
||||||
except OSError as e:
|
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:
|
def close(self) -> None:
|
||||||
"""Close the application and exit."""
|
"""Close the application and exit."""
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user