Skip to content

Commit

Permalink
Fix loading loc files on Windows; change some mod errors to warns (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMakesGames authored May 10, 2024
1 parent f63f264 commit 9b4e4d2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions stellarisdashboard/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,8 @@ def game_data_dirs(self):
if mod_data_path is not None
]
except Exception as e:
logger.error(f"Failed to read enabled mods {dlc_load_path}")
logger.error(e)
logger.warn(f"Failed to read enabled mods from {dlc_load_path}. Using only base game data.")
logger.warn(e)
return [self.stellaris_install_path]

@property
Expand Down Expand Up @@ -460,13 +460,13 @@ def _get_mod_data_dir(mod_descriptor_path: pathlib.Path):
if match:
return pathlib.Path(match.group(1))
except Exception as e:
logger.error(f"Failed to read mod path from {mod_descriptor_path}")
logger.error(e)
logger.warn(f"Failed to read mod path from {mod_descriptor_path}")
logger.warn(e)
return None


def _localization_file_matches_language(file_path: pathlib.Path, language: str):
with open(file_path, "r") as f:
with open(file_path, "r", encoding="utf-8") as f:
first_line = f.readline()
match = re.match(rf"^\ufeff\s*{language}\s*:\s*$", first_line)
return match is not None
Expand Down

0 comments on commit 9b4e4d2

Please sign in to comment.