Skip to content

Commit

Permalink
ruff fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementJ18 committed Jan 25, 2024
1 parent 802dfe9 commit 950d346
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions pyBIG/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
from .large_archive import LargeArchive

__version__ = "0.3.0"

__all__ = ["Archive", "LargeArchive"]
1 change: 0 additions & 1 deletion pyBIG/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import logging
import os
import struct
from typing import List

from .base_archive import BaseArchive, Entry, FileAction

Expand Down
6 changes: 4 additions & 2 deletions pyBIG/base_archive.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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."""
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/functional_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 950d346

Please sign in to comment.