1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-12 15:27:14 +03:00

[2114] Additional Cleanup

This commit is contained in:
David Sangrey 2024-06-10 18:16:11 -04:00
parent f8b7a8b919
commit da5d317797
No known key found for this signature in database
GPG Key ID: 3AEADBB0186884BC
4 changed files with 7 additions and 7 deletions

View File

@ -230,7 +230,7 @@ def main(): # noqa: C901, CCR001
try: try:
monitor.currentdir = Path(config.get_str('journaldir', default=config.default_journal_dir)) monitor.currentdir = Path(config.get_str('journaldir', default=config.default_journal_dir))
if not monitor.currentdir: if not monitor.currentdir:
monitor.currentdir = Path(config.default_journal_dir) monitor.currentdir = config.default_journal_dir_path
logger.debug(f'logdir = "{monitor.currentdir}"') logger.debug(f'logdir = "{monitor.currentdir}"')
logfile = monitor.journal_newest_filename(monitor.currentdir) logfile = monitor.journal_newest_filename(monitor.currentdir)

View File

@ -49,7 +49,7 @@ def get_sys_report(config: config.AbstractConfig) -> str:
) )
) )
if not monitor.currentdir: if not monitor.currentdir:
monitor.currentdir = pathlib.Path(config.default_journal_dir) monitor.currentdir = config.default_journal_dir_path
try: try:
logfile = monitor.journal_newest_filename(monitor.currentdir) logfile = monitor.journal_newest_filename(monitor.currentdir)
if logfile is None: if logfile is None:

View File

@ -232,7 +232,7 @@ class Translations:
if __file__: if __file__:
return pathlib.Path(__file__).parent.joinpath(LOCALISATION_DIR).resolve() return pathlib.Path(__file__).parent.joinpath(LOCALISATION_DIR).resolve()
return pathlib.Path(LOCALISATION_DIR).resolve() return LOCALISATION_DIR.resolve()
def file(self, lang: str, plugin_path: pathlib.Path | None = None) -> TextIO | None: def file(self, lang: str, plugin_path: pathlib.Path | None = None) -> TextIO | None:
""" """
@ -396,8 +396,8 @@ if __name__ == "__main__":
(match.group(4) and (match.group(4)[1:].strip()) + '. ' or '') + f'[{pathlib.Path(f).name}]' (match.group(4) and (match.group(4)[1:].strip()) + '. ' or '') + f'[{pathlib.Path(f).name}]'
) )
if seen: if seen:
target_path = pathlib.Path(LOCALISATION_DIR / 'en.template.new') target_path = LOCALISATION_DIR / 'en.template.new'
pathlib.Path(target_path).parent.mkdir(parents=True, exist_ok=True) target_path.parent.mkdir(parents=True, exist_ok=True)
with open(target_path, 'w', encoding='utf-8') as target_file: with open(target_path, 'w', encoding='utf-8') as target_file:
target_file.write(f'/* Language name */\n"{LANGUAGE_ID}" = "English";\n\n') target_file.write(f'/* Language name */\n"{LANGUAGE_ID}" = "English";\n\n')
for thing in sorted(seen, key=str.lower): for thing in sorted(seen, key=str.lower):

View File

@ -53,9 +53,9 @@ def export(data: companion.CAPIData, requested_filename: str | None = None) -> N
# Write # Write
output_directory = config.get_str('outdir') output_directory = Path(config.get_str('outdir'))
ship_time = time.strftime('%Y-%m-%dT%H.%M.%S', time.localtime(query_time)) ship_time = time.strftime('%Y-%m-%dT%H.%M.%S', time.localtime(query_time))
file_path = output_directory / Path(f"{ship}.{ship_time}.txt") file_path = output_directory / f"{ship}.{ship_time}.txt"
with open(file_path, 'wt') as h: with open(file_path, 'wt') as h:
h.write(string) h.write(string)