Skip to content

Commit 78df7ca

Browse files
isHarryhK0lb3
authored andcommitted
chore(files): fix typo and remove legacy code
1 parent 740d33a commit 78df7ca

3 files changed

Lines changed: 18 additions & 21 deletions

File tree

‎UnityPy/files/BundleFile.py‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ def save(self, packer=None):
201201
original - uses the original flags
202202
"""
203203
# file_header
204-
# signature (string_to_null)
205-
# format (int)
204+
# signature (string_to_null)
205+
# format (int)
206206
# version_player (string_to_null)
207207
# version_engine (string_to_null)
208208
writer = EndianBinaryWriter()
@@ -252,11 +252,11 @@ def save_fs(self, writer: EndianBinaryWriter, data_flag: int, block_info_flag: i
252252
# data_flag
253253

254254
# header:
255-
# bundle_size (long)
256-
# compressed_size (int)
257-
# uncompressed_size (int)
258-
# flag (int)
259-
# ?padding? (bool)
255+
# bundle_size (long)
256+
# compressed_size (int)
257+
# uncompressed_size (int)
258+
# flag (int)
259+
# ?padding? (bool)
260260
# This will be written at the end,
261261
# because the size can only be calculated after the data compression,
262262

@@ -266,21 +266,21 @@ def save_fs(self, writer: EndianBinaryWriter, data_flag: int, block_info_flag: i
266266
# *read compressed_size -> uncompressed_size
267267
# 0x10 offset
268268
# *read blocks infos of the data stream
269-
# count (int)
269+
# count (int)
270270
# (
271-
# uncompressed_size(uint)
272-
# compressed_size (uint)
273-
# flag(short)
271+
# uncompressed_size (uint)
272+
# compressed_size (uint)
273+
# flag (short)
274274
# )
275275
# *decompression via info.flag & 0x3F
276276

277277
# *afterwards the file positions
278-
# file_count (int)
278+
# file_count (int)
279279
# (
280280
# offset (long)
281-
# size (long)
282-
# flag (int)
283-
# name (string_to_null)
281+
# size (long)
282+
# flag (int)
283+
# name (string_to_null)
284284
# )
285285

286286
# file list & file data

‎UnityPy/files/File.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
DirectoryInfo = namedtuple("DirectoryInfo", "path offset size")
1414

1515

16-
class File(object):
16+
class File:
1717
name: str
1818
files: Dict[str, File]
1919
environment: Environment
@@ -34,7 +34,7 @@ def __init__(
3434
self.is_changed = False
3535
self.cab_file = "CAB-UnityPy_Mod.resS"
3636
self.parent = parent
37-
self.environment = self.environment = (
37+
self.environment = (
3838
getattr(parent, "environment", parent) if parent else None
3939
)
4040
self.name = basename(name) if isinstance(name, str) else ""
@@ -98,7 +98,7 @@ def read_files(self, reader: EndianBinaryReader, files: list):
9898
def get_writeable_cab(self, name: str = None):
9999
"""
100100
Creates a new cab file in the bundle that contains the given data.
101-
This is usefull for asset types that use resource files.
101+
This is useful for asset types that use resource files.
102102
"""
103103

104104
if not name:

‎UnityPy/files/SerializedFile.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,6 @@ def __len__(self) -> int:
576576
def __getattr__(self, name: str) -> PPtr[Object]:
577577
return self.container_dict[name]
578578

579-
def __or__(self, other: ContainerHelper):
580-
return ContainerHelper(list(set(self.container + other.container)))
581-
582579
def __str__(self) -> str:
583580
return f'{{{", ".join(f"{key}: {value}" for key, value in self.items())}}}'
584581

0 commit comments

Comments
 (0)