File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import configparser
22import hashlib
3- import itertools
43import os
54import re
65import shutil
1211from xml .etree import ElementTree
1312from xml .etree .ElementTree import Element
1413
14+ import mobase
1515from PyQt6 .QtCore import (
1616 qDebug ,
1717 qInfo ,
1818 qWarning ,
1919)
2020
21- import mobase
22-
2321from . import bg3_utils
2422
2523
@@ -139,15 +137,14 @@ def _get_metadata_for_file(
139137 meta_file .unlink (missing_ok = True )
140138 if self ._utils .extract_full_package :
141139 Path (str (meta_file )[:- 4 ]).unlink (missing_ok = True )
142- elif file .is_dir () and self ._folder_pattern .search (file .name ):
143- # qDebug(f"directory is not packable: {file}")
144- return ""
145- elif next (
146- itertools .chain (
147- file .glob (f"{ folder } /*" ) for folder in bg3_utils .loose_file_folders
148- ),
149- False ,
150- ):
140+ elif file .is_dir ():
141+ if self ._folder_pattern .search (file .name ):
142+ return ""
143+ for folder in bg3_utils .loose_file_folders :
144+ if next (file .glob (f"{ folder } /*" ), False ):
145+ break
146+ else :
147+ return ""
151148 qInfo (f"packable dir: { file } " )
152149 if (file .parent / f"{ file .name } .pak" ).exists () or (
153150 file .parent / "Mods" / f"{ file .name } .pak"
@@ -187,7 +184,6 @@ def _get_metadata_for_file(
187184 lambda : meta_files [0 ],
188185 )
189186 else :
190- # qDebug(f"non packable dir, unlikely to be used by the game: {file}")
191187 return ""
192188 except Exception :
193189 qWarning (traceback .format_exc ())
You can’t perform that action at this time.
0 commit comments