mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-11-22 03:06:59 +03:00
[Minor] Replace Dep'd Functions, Minor Type Hinting
This commit is contained in:
4 files changed
+6
-5
No files matched your search
+1
-1
@@ -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
@@ -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
@@ -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
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user