1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

collapre.py: flake8/mypy fixups

This commit is contained in:
Athanasius 2021-12-17 11:12:55 +00:00
parent bcabd97f4c
commit 3384412632
No known key found for this signature in database
GPG Key ID: AE3E527847057C7D

View File

@ -14,14 +14,14 @@ import outfitting
from edmc_data import companion_category_map, ship_name_map
def __make_backup(file_name: str, suffix: str = '.bak') -> None:
def __make_backup(file_name: pathlib.Path, suffix: str = '.bak') -> None:
"""
Rename the given file to $file.bak, removing any existing $file.bak. Assumes $file exists on disk.
:param file_name: The name of the file to make a backup of
:param suffix: The suffix to use for backup files (default '.bak')
"""
backup_name = file_name + suffix
backup_name = file_name.parent / (file_name.name + suffix)
if isfile(backup_name):
os.unlink(backup_name)
@ -150,7 +150,7 @@ def addships(data) -> None: # noqa: CCR001
if not data['lastStarport'].get('ships'):
return
shipfile = 'shipyard.csv'
shipfile = pathlib.Path('shipyard.csv')
ships = {}
fields = ('id', 'symbol', 'name')