diff --git a/pyBIG/__init__.py b/pyBIG/__init__.py index c73d4b4..d0ac65c 100644 --- a/pyBIG/__init__.py +++ b/pyBIG/__init__.py @@ -2,3 +2,5 @@ from .large_archive import LargeArchive __version__ = "0.3.0" + +__all__ = ["Archive", "LargeArchive"] diff --git a/pyBIG/archive.py b/pyBIG/archive.py index 54ad434..feb708c 100644 --- a/pyBIG/archive.py +++ b/pyBIG/archive.py @@ -2,7 +2,6 @@ import logging import os import struct -from typing import List from .base_archive import BaseArchive, Entry, FileAction diff --git a/pyBIG/base_archive.py b/pyBIG/base_archive.py index 9e665dd..1959ba7 100644 --- a/pyBIG/base_archive.py +++ b/pyBIG/base_archive.py @@ -1,6 +1,6 @@ import enum from collections import namedtuple -from typing import List +from typing import Dict, List import logging import struct import os @@ -17,6 +17,8 @@ class FileAction(enum.Enum): class BaseArchive: + modified_entries: Dict[str, EntryEdit] + def _pack(self): """Rewrite the archive with the modifications stores in self.modified_entries.""" @@ -72,7 +74,7 @@ def file_exists(self, name: str) -> bool: True if the file exists, else false """ if name in self.modified_entries: - return not self.modified_entries[name].action is FileAction.REMOVE + return self.modified_entries[name].action is not FileAction.REMOVE return name in self.entries diff --git a/tests/functional_tests.py b/tests/functional_tests.py index c5051a9..bcf0f7e 100644 --- a/tests/functional_tests.py +++ b/tests/functional_tests.py @@ -5,7 +5,7 @@ from pyBIG import Archive, LargeArchive -# logging.basicConfig(level=logging.INFO) +logging.basicConfig(level=logging.INFO) TEST_FILE = "data\\ini\\weapon.ini" TEST_CONTENT = "john"