Skip to content

Commit

Permalink
Update main.py layout fixing using Black
Browse files Browse the repository at this point in the history
Second attempt to correct, ran it through Black so hopefully this will now clear the autobuild issues.
  • Loading branch information
NebularNerd authored Mar 7, 2024
1 parent ed74e52 commit 284daa4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions puremagic/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,21 +151,21 @@ def _identify_all(header: bytes, footer: bytes, ext=None) -> List[PureMagicWithC
for matched in matches:
if matched.byte_match in multi_part_header_dict:
for magic_row in multi_part_header_dict[matched.byte_match]:
if '-' in str(magic_row.offset):
if "-" in str(magic_row.offset):
start = magic_row.offset
end = magic_row.offset + len(magic_row.byte_match)
match_area = footer[start:end] if end != 0 else footer[start:]
if match_area == magic_row.byte_match:
new_matches.add(
PureMagic(
byte_match=matched.byte_match + magic_row.byte_match,
byte_match=matched.byte_match + magic_row.byte_match,
offset=magic_row.offset,
extension=magic_row.extension,
mime_type=magic_row.mime_type,
name=magic_row.name,
)
)
else:
)
else:
start = magic_row.offset
end = magic_row.offset + len(magic_row.byte_match)
if end > len(header):
Expand All @@ -178,8 +178,8 @@ def _identify_all(header: bytes, footer: bytes, ext=None) -> List[PureMagicWithC
extension=magic_row.extension,
mime_type=magic_row.mime_type,
name=magic_row.name,
)
)
)

matches.extend(list(new_matches))
return _confidence(matches, ext)
Expand Down

0 comments on commit 284daa4

Please sign in to comment.