[Minor] Replace Dep'd Functions, Minor Type Hinting

This commit is contained in:
David Sangrey committed 2025-11-09 13:41:07 -05:00
1 parent 6d474abd01
commit 5f70a8d7a4
4 files changed
+6 -5

No files matched your search

+1 -1
View File
@@ -1637,7 +1637,7 @@ updated to using Python 3.9.8.
- When the new option is not active, the application will minimize to the
taskbar as normal.
Bug Fixex
Bug Fixes
---
* If a CAPI query failed in such a way that no `requests.Response` object
+1 -1
View File
@@ -821,7 +821,7 @@ class Session:
capi_data = CAPIData(capi_json, capi_host, capi_endpoint, monitor.cmdr)
self.capi_raw_data.record_endpoint(
capi_endpoint, r.content.decode(encoding='utf-8'),
datetime.datetime.utcnow()
datetime.datetime.now(datetime.timezone.utc)
)
except requests.ConnectionError as e:
+2 -2
View File
@@ -67,7 +67,7 @@ class EDLogs(FileSystemEventHandler):
def __init__(self) -> None:
# TODO(A_D): A bunch of these should be switched to default values (eg '' for strings) and no longer be Optional
FileSystemEventHandler.__init__(self) # futureproofing - not need for current version of watchdog
self.root: 'tkinter.Tk' = None # type: ignore # Don't use Optional[] - mypy thinks no methods
self.root: tkinter.Tk = None # type: ignore # Don't use Optional[] - mypy thinks no methods
self.currentdir: str | None = None # The actual logdir that we're monitoring
self.logfile: str | None = None
self.observer: BaseObserver | None = None
@@ -188,7 +188,7 @@ class EDLogs(FileSystemEventHandler):
},
}
def start(self, root: 'tkinter.Tk') -> bool: # noqa: CCR001
def start(self, root: tkinter.Tk) -> bool: # noqa: CCR001
"""
Start journal monitoring.
+2 -1
View File
@@ -5,6 +5,7 @@ Copyright (c) EDCD, All Rights Reserved
Licensed under the GNU General Public License.
See LICENSE file.
"""
import os
from pathlib import Path
from edmc_data import ship_name_map
@@ -17,7 +18,7 @@ def ship_file_name(ship_name: str, ship_type: str) -> str:
name = Path(name).with_suffix("").name
# Check if the name is a reserved filename
if Path(name).is_reserved():
if os.path.isreserved(name):
name += "_"
return name.translate(