diff --git a/contrib/scripts/sensitive_strings.py b/contrib/scripts/sensitive_strings.py index 75e25e0b6..e28f83631 100644 --- a/contrib/scripts/sensitive_strings.py +++ b/contrib/scripts/sensitive_strings.py @@ -109,7 +109,7 @@ def _is_binary_file(self, file_path: str, file_name_ext: str): ext = ext.lower() if ext == ".ipynb": is_binary_file = True - if self._is_img_ext(ext): + elif self._is_img_ext(ext): if ext in self._text_file_extensions: is_binary_file = False elif (f"{file_path}/{file_name_ext}" in self._text_file_path_name_exts) or ( @@ -118,6 +118,11 @@ def _is_binary_file(self, file_path: str, file_name_ext: str): is_binary_file = False else: is_binary_file = True + elif ft.file_size(ft.join(file_path, file_name_ext)) > 1e6: + # assume any file > 1MB is a binary file, in order to prevent + # sensitive_strings from taking hours to check these files + # needlessly + is_binary_file = True if not is_binary_file: # attempt to parse the file as a text file try: diff --git a/opencsp/__init__.py b/opencsp/__init__.py index 2c8c5ba0a..b77adbc7f 100644 --- a/opencsp/__init__.py +++ b/opencsp/__init__.py @@ -66,8 +66,4 @@ def _opencsp_settings_dirs() -> list[str]: opencsp_settings = configparser.ConfigParser(allow_no_value=True) opencsp_settings.read(_settings_files) -for section in opencsp_settings.sections(): - for key in opencsp_settings[section]: - print(f"opencsp_settings[{section}][{key}]={opencsp_settings[section][key]}") - __all__ = ['opencsp_settings']