Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
Cleaning up tags and metadata for distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
William McLendon committed Dec 23, 2021
1 parent f04da5e commit 74628d5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
4 changes: 3 additions & 1 deletion examples/ConfigParserEnhanced-example-01.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from configparserenhanced import ConfigParserEnhanced



def test_configparserEnhanced(filename="config.ini"):
print(f"Using filename: `{filename}`\n")

Expand Down Expand Up @@ -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("")

Expand All @@ -46,6 +47,7 @@ def test_configparserEnhanced(filename="config.ini"):
return 0



if __name__ == "__main__":
test_configparserEnhanced(filename="example-01.ini")
print("Done.")
6 changes: 3 additions & 3 deletions exec-autoformat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
source scripts/common.bash

printf "${yellow}"
print_banner "Reformatting - Started"
print_banner "Auto Formatting - Started"
printf "${normal}\n"

exclude_dirs=(
Expand All @@ -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"

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = [
Expand Down
10 changes: 6 additions & 4 deletions src/configparserenhanced/ConfigParserEnhanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1553,6 +1553,7 @@ def test_ConfigParserEnhanced_get_known_operations(self):
"""
Check that section validation operates correctly.
"""

class ConfigParserEnhancedTest(ConfigParserEnhanced):

@ConfigParserEnhanced.operation_handler
Expand All @@ -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))
Expand All @@ -1587,7 +1587,6 @@ def _handler_handlebars_are_cool(




# ===========================================================
# Test ConfigParserEnhancedDataTest
# ===========================================================
Expand Down

0 comments on commit 74628d5

Please sign in to comment.