Compare commits

..

2 Commits

Author SHA1 Message Date
Peery 69f387ce5a
Fixed folder creation
Fixed an Issue where if a nested folder was used it would not create all of them but only the parent and then crash.
10 months ago
Peery be194b2ad6
Fixed crash with unrecognized mods
This fixes issue #4 by giving unrecognized aka "untracked" mods an "Not Tracked" version string.
11 months ago

@ -6,7 +6,7 @@ import os
import shutil
import sys
import tempfile
from typing import Tuple, List
from typing import Tuple
from zipfile import ZipFile
from PyQt6 import QtWidgets
@ -17,7 +17,9 @@ from window.main_window import MainWindow
class ModManager:
VERSION = "0.3"
VERSION = "0.3.1"
UNKNOWN_MOD_VERSION_STRING = "Not Tracked"
def __init__(self, log_level: int = logging.INFO):
self.__logger = logging.getLogger("ModManager")
@ -283,7 +285,7 @@ class ModManager:
if file in unresolved_files:
unknown_mod[os.path.basename(file)] = {"mod_files": [file]}
for key in unknown_mod.keys():
self.installed_mods[key] = unknown_mod[key]
self.installed_mods[(key, ModManager.UNKNOWN_MOD_VERSION_STRING)] = unknown_mod[key]
self.__window.set_installed_mods(self.installed_mods)
self.__window.set_available_mods(self.available_mods)
@ -387,7 +389,7 @@ class ModManager:
parent_dir = os.path.join(self.__settings.get_game_folder(), file).split(os.path.basename(file))[0]\
.replace("/", os.path.sep)
if not os.path.exists(parent_dir):
os.mkdir(parent_dir)
os.makedirs(parent_dir)
if not os.path.exists(os.path.join(self.__settings.get_game_folder().replace("/", os.path.sep),
file.replace("/", os.path.sep))):
self.__logger.debug(

@ -81,7 +81,7 @@ class MainWindow(QtWidgets.QMainWindow):
if (mod_name, mod_version) in self.parent.available_mods.keys():
mod_version = self.parent.available_mods[(mod_name, mod_version)]['version']
else:
mod_version = "Not Tracked"
mod_version = self.parent.UNKNOWN_MOD_VERSION_STRING
item = QStandardItem(mod_name + f" ({mod_version})")
item.setFlags(Qt.ItemFlag.ItemIsUserCheckable | Qt.ItemFlag.ItemIsEnabled)
item.setData(Qt.CheckState.Unchecked, Qt.ItemDataRole.CheckStateRole)

Loading…
Cancel
Save