diff --git a/examples/ConfigParserEnhanced-example-01.py b/examples/ConfigParserEnhanced-example-01.py index 05e15fb8..dede68f5 100755 --- a/examples/ConfigParserEnhanced-example-01.py +++ b/examples/ConfigParserEnhanced-example-01.py @@ -8,6 +8,7 @@ from configparserenhanced import ConfigParserEnhanced + def test_configparserEnhanced(filename="config.ini"): print(f"Using filename: `{filename}`\n") @@ -36,7 +37,7 @@ def test_configparserEnhanced(filename="config.ini"): print("Section Details:") for section_name, options in parser.configparserenhanceddata.items(): print(f"[{section_name}]") - for key,value in options.items(): + for key, value in options.items(): print(f"{key} : {value}") print("") @@ -46,6 +47,7 @@ def test_configparserEnhanced(filename="config.ini"): return 0 + if __name__ == "__main__": test_configparserEnhanced(filename="example-01.ini") print("Done.") diff --git a/exec-autoformat.sh b/exec-autoformat.sh index 07d1acad..6fa95ee3 100755 --- a/exec-autoformat.sh +++ b/exec-autoformat.sh @@ -4,7 +4,7 @@ source scripts/common.bash printf "${yellow}" -print_banner "Reformatting - Started" +print_banner "Auto Formatting - Started" printf "${normal}\n" exclude_dirs=( @@ -21,9 +21,9 @@ for exc in ${exclude_dirs[*]}; do exclude_opts+=("${exc}") done -execute_command "yapf -vv -i -p -r ${exclude_opts[*]} ." +execute_command_checked "yapf -vv -i -p -r ${exclude_opts[*]} ." printf "${yellow}" -print_banner "Reformatting - Done" +print_banner "Auto Formatting - Done" printf "${normal}\n" diff --git a/pyproject.toml b/pyproject.toml index 59f79566..4fec5095 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "configparserenhanced" description = "A tool that extends configparser to enable enhanced processing of .ini files." -version = "0.8.1.1a1" +version = "0.8.1.1" license = "LICENSE" readme = "README.md" keywords = [ diff --git a/src/configparserenhanced/ConfigParserEnhanced.py b/src/configparserenhanced/ConfigParserEnhanced.py index 4093de5c..3570f11b 100644 --- a/src/configparserenhanced/ConfigParserEnhanced.py +++ b/src/configparserenhanced/ConfigParserEnhanced.py @@ -370,7 +370,9 @@ def configparserenhanceddata(self): # P U B L I C A P I M E T H O D S # --------------------------------------- - def write(self, file_object, space_around_delimiters=True, section=None, use_base_class_parser=True) -> int: + def write( + self, file_object, space_around_delimiters=True, section=None, use_base_class_parser=True + ) -> int: """File writer utility for ConfigParserEnhanced objects. Writes the output of :py:meth:`unroll_to_str` to a file. @@ -428,7 +430,7 @@ def assert_file_all_sections_handled(self) -> int: output = 1 if output != 0: - tmp_fileslist = [ str(x) for x in self.inifilepath ] + tmp_fileslist = [str(x) for x in self.inifilepath] message = self.get_known_operations_message() message += "\nThis configuration was loaded from the file(s):\n|- " message += "\n|- ".join(tmp_fileslist) @@ -478,13 +480,13 @@ def assert_section_all_options_handled(self, section_name: str, do_raise: bool = section_data = self.configparserenhanceddata.get(section_name) if len(section_data): - message = f"Unhandled option found in section `{section_name}`" + message = f"Unhandled option found in section `{section_name}`" message += " or one of its dependent sections.\n" message += "The following entries are unhandled:\n" for k, v in section_data.items(): message += f"|- '{k}'\n" if do_raise: - tmp_fileslist = [ str(x) for x in self.inifilepath ] + tmp_fileslist = [str(x) for x in self.inifilepath] message += self.get_known_operations_message() message += "\nThis configuration was loaded from the file(s):\n|- " message += "\n|- ".join(tmp_fileslist) diff --git a/src/configparserenhanced/unittests/test_ConfigParserEnhanced.py b/src/configparserenhanced/unittests/test_ConfigParserEnhanced.py index 0a47af05..859be719 100644 --- a/src/configparserenhanced/unittests/test_ConfigParserEnhanced.py +++ b/src/configparserenhanced/unittests/test_ConfigParserEnhanced.py @@ -1553,6 +1553,7 @@ def test_ConfigParserEnhanced_get_known_operations(self): """ Check that section validation operates correctly. """ + class ConfigParserEnhancedTest(ConfigParserEnhanced): @ConfigParserEnhanced.operation_handler @@ -1562,7 +1563,6 @@ def _handler_handlebars_are_cool( print("Handlebars are cool!") return 0 - filename_ini = find_config_ini(filename="config_test_configparserenhanced_validation_02.ini") print("\n") print("Load file: {}".format(filename_ini)) @@ -1587,7 +1587,6 @@ def _handler_handlebars_are_cool( - # =========================================================== # Test ConfigParserEnhancedDataTest # ===========================================================