Changeset View
Changeset View
Standalone View
Standalone View
bin/Packager/CollectionPackagerBase.py
Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Line(s) | 178 | def whitelisted(self, filename : os.DirEntry, root : str, whiteList : [re]=None) -> bool: | |||
---|---|---|---|---|---|
180 | if whiteList is None: | 180 | if whiteList is None: | ||
181 | whiteList = self.whitelist | 181 | whiteList = self.whitelist | ||
182 | return self.blacklisted(filename, root=root, blackList=whiteList, message="whitelisted") | 182 | return self.blacklisted(filename, root=root, blackList=whiteList, message="whitelisted") | ||
183 | 183 | | |||
184 | def blacklisted(self, filename : os.DirEntry, root : str, blackList : [re]=None, message : str="blacklisted") -> bool: | 184 | def blacklisted(self, filename : os.DirEntry, root : str, blackList : [re]=None, message : str="blacklisted") -> bool: | ||
185 | """ return False if file is not blacklisted, and True if it is blacklisted """ | 185 | """ return False if file is not blacklisted, and True if it is blacklisted """ | ||
186 | if blackList is None: | 186 | if blackList is None: | ||
187 | blackList = self.blacklist | 187 | blackList = self.blacklist | ||
188 | relFilePath = os.path.relpath(filename.path, root) | 188 | CraftCore.log.debug(f"Start filtering: {message}") | ||
189 | for pattern in blackList: | 189 | return utils.regexFileFilter(filename, root, blackList) | ||
190 | if pattern.search(relFilePath): | | |||
191 | CraftCore.log.debug(f"{relFilePath} is {message}: {pattern.pattern}") | | |||
192 | return True | | |||
193 | return False | | |||
194 | 190 | | |||
195 | def _filterQtBuildType(self, filename): | 191 | def _filterQtBuildType(self, filename): | ||
196 | if not self.__deployQtSdk: | 192 | if not self.__deployQtSdk: | ||
197 | return True | 193 | return True | ||
198 | filename = OsUtils.toNativePath(filename) | 194 | filename = OsUtils.toNativePath(filename) | ||
199 | if self.__qtSdkDir not in filename: | 195 | if self.__qtSdkDir not in filename: | ||
200 | return True | 196 | return True | ||
201 | 197 | | |||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |