From 86bd1091979daa404e9ddc39e7919d01008705e5 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Wed, 8 Jan 2025 01:16:24 +1000 Subject: [PATCH] Fix Python black (#436) --- config/module/utils.py | 10 ++++++---- config/sync.py | 31 ++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/config/module/utils.py b/config/module/utils.py index d19f966e..76bbe655 100644 --- a/config/module/utils.py +++ b/config/module/utils.py @@ -50,7 +50,9 @@ def command_layout_type(item: Dict[str, Any], prefix: str, value: str) -> str: ) -def command_layout_style_type(item: Dict[str, Any], prefix: str, value: str, extra: str = 'none') -> str: +def command_layout_style_type( + item: Dict[str, Any], prefix: str, value: str, extra: str = "none" +) -> str: """ Generates a formatted command string based on the item and value provided. :param item: Dictionary containing item data. @@ -75,7 +77,7 @@ def command_layout_style_type(item: Dict[str, Any], prefix: str, value: str, ext else "NULL" ) - if extra == 'none': + if extra == "none": return ( f"({itemid}, " f'"{idtext}", ' @@ -84,7 +86,7 @@ def command_layout_style_type(item: Dict[str, Any], prefix: str, value: str, ext f'"{generate_name}", ' f"{type}, {reserved_values}, NULL)" ) - elif extra == '': + elif extra == "": return ( f"({itemid}, " f'"{idtext}", ' @@ -93,7 +95,7 @@ def command_layout_style_type(item: Dict[str, Any], prefix: str, value: str, ext f'"{generate_name}", ' f"{type}, {reserved_values}, NULL, value_handler_simple)" ) - else: + else: return ( f"({itemid}, " f'"{idtext}", ' diff --git a/config/sync.py b/config/sync.py index 2814406f..5ee3dbff 100644 --- a/config/sync.py +++ b/config/sync.py @@ -96,7 +96,9 @@ def prettify_layout_attribute_type(item: Dict[str, Any], group: Dict[str, Any]) else: return ( key_normal - + command_layout_style_type(item, "AST_LAYOUT_ATTRIBUTE_TYPE_", values, value_handler) + + command_layout_style_type( + item, "AST_LAYOUT_ATTRIBUTE_TYPE_", values, value_handler + ) + "\n" ) @@ -168,7 +170,10 @@ def prettify_layout_attribute_style_type( result += ( key_hide + command_layout_style_type( - item, "AST_LAYOUT_ATTRIBUTE_STYLE_TYPE_", value, value_handler + item, + "AST_LAYOUT_ATTRIBUTE_STYLE_TYPE_", + value, + value_handler, ) + "\n" ) @@ -176,7 +181,10 @@ def prettify_layout_attribute_style_type( result += ( key_repeat + command_layout_style_type( - item, "AST_LAYOUT_ATTRIBUTE_STYLE_TYPE_", value, value_handler + item, + "AST_LAYOUT_ATTRIBUTE_STYLE_TYPE_", + value, + value_handler, ) + "\n" ) @@ -197,7 +205,10 @@ def prettify_layout_attribute_style_type( result += ( key_main + command_layout_style_type( - item, "AST_LAYOUT_ATTRIBUTE_STYLE_TYPE_", value, value_handler + item, + "AST_LAYOUT_ATTRIBUTE_STYLE_TYPE_", + value, + value_handler, ) + "\n" ) @@ -205,7 +216,10 @@ def prettify_layout_attribute_style_type( result += ( key_repeat + command_layout_style_type( - item, "AST_LAYOUT_ATTRIBUTE_STYLE_TYPE_", value, value_handler + item, + "AST_LAYOUT_ATTRIBUTE_STYLE_TYPE_", + value, + value_handler, ) + "\n" ) @@ -399,7 +413,7 @@ def prettify_layout_type_attributes_all( return "{" + f" {itemid}, {var_attrs}, {var_attrs_length}" + " },\n" else: return "" - + def prettify_layout_type_attributes_values_extern( item: Dict[str, Any], group: Dict[str, Any] @@ -458,7 +472,10 @@ def prettify_layout_type_attributes_values( result += "};\n" result += f"const size_t {var_attrs_length} = sizeof({var_attrs}) / sizeof({var_attrs}[0]);\n" else: - result += f"ast_layout_attribute_type_t {var_attrs}[] = " + "{ AST_LAYOUT_ATTRIBUTE_TYPE_ERROR };\n" + result += ( + f"ast_layout_attribute_type_t {var_attrs}[] = " + + "{ AST_LAYOUT_ATTRIBUTE_TYPE_ERROR };\n" + ) result += f"const size_t {var_attrs_length} = 0;\n" return result