Skip to content

Commit

Permalink
[2114] Additional Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Rixxan committed Jun 10, 2024
1 parent f8b7a8b commit da5d317
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion EDMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def main(): # noqa: C901, CCR001
try:
monitor.currentdir = Path(config.get_str('journaldir', default=config.default_journal_dir))
if not monitor.currentdir:
monitor.currentdir = Path(config.default_journal_dir)
monitor.currentdir = config.default_journal_dir_path

logger.debug(f'logdir = "{monitor.currentdir}"')
logfile = monitor.journal_newest_filename(monitor.currentdir)
Expand Down
2 changes: 1 addition & 1 deletion EDMCSystemProfiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_sys_report(config: config.AbstractConfig) -> str:
)
)
if not monitor.currentdir:
monitor.currentdir = pathlib.Path(config.default_journal_dir)
monitor.currentdir = config.default_journal_dir_path
try:
logfile = monitor.journal_newest_filename(monitor.currentdir)
if logfile is None:
Expand Down
6 changes: 3 additions & 3 deletions l10n.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def respath(self) -> pathlib.Path:
if __file__:
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:
"""
Expand Down Expand Up @@ -396,8 +396,8 @@ def __init__(self):
(match.group(4) and (match.group(4)[1:].strip()) + '. ' or '') + f'[{pathlib.Path(f).name}]'
)
if seen:
target_path = pathlib.Path(LOCALISATION_DIR / 'en.template.new')
pathlib.Path(target_path).parent.mkdir(parents=True, exist_ok=True)
target_path = LOCALISATION_DIR / 'en.template.new'
target_path.parent.mkdir(parents=True, exist_ok=True)
with open(target_path, 'w', encoding='utf-8') as target_file:
target_file.write(f'/* Language name */\n"{LANGUAGE_ID}" = "English";\n\n')
for thing in sorted(seen, key=str.lower):
Expand Down
4 changes: 2 additions & 2 deletions loadout.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def export(data: companion.CAPIData, requested_filename: str | None = None) -> N

# 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))
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:
h.write(string)

0 comments on commit da5d317

Please sign in to comment.