From c80325ac59b47ab1db06d789f92d293f5eee6011 Mon Sep 17 00:00:00 2001 From: cluny85 Date: Sat, 17 May 2025 14:13:40 +0200 Subject: [PATCH] Refactor: Improve code readability in EnhancedUUIDGeneratorNode This commit refactors the `EnhancedUUIDGeneratorNode` class to improve code readability. It achieves this by: - Adding line breaks to long lines within the `INPUT_TYPES` method for better visual structure. - Adding line breaks to long lines within the `generate_uuid` method for improved clarity, particularly when calling `get_namespace`. --- src/enhanced_uuid_generator.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/enhanced_uuid_generator.py b/src/enhanced_uuid_generator.py index 895e489..0056490 100644 --- a/src/enhanced_uuid_generator.py +++ b/src/enhanced_uuid_generator.py @@ -6,8 +6,14 @@ class EnhancedUUIDGeneratorNode: def INPUT_TYPES(cls): return { "required": { - "uuid_type": (["UUID1", "UUID3", "UUID4", "UUID5"], {"default": "UUID4"}), - "namespace_type": (["DNS", "URL", "OID", "X500", "CUSTOM"], {"default": "DNS"}), + "uuid_type": ( + ["UUID1", "UUID3", "UUID4", "UUID5"], + {"default": "UUID4"} + ), + "namespace_type": ( + ["DNS", "URL", "OID", "X500", "CUSTOM"], + {"default": "DNS"} + ), "name_string": ("STRING", {"default": "example.com"}), "trigger": ("INT", {"default": 0, "min": 0, "max": 1}), }, @@ -55,10 +61,14 @@ class EnhancedUUIDGeneratorNode: elif uuid_type == "UUID4": generated_uuid = uuid.uuid4() elif uuid_type == "UUID3": - namespace = self.get_namespace(namespace_type, custom_namespace_uuid) + namespace = self.get_namespace( + namespace_type, custom_namespace_uuid + ) generated_uuid = uuid.uuid3(namespace, name_string) elif uuid_type == "UUID5": - namespace = self.get_namespace(namespace_type, custom_namespace_uuid) + namespace = self.get_namespace( + namespace_type, custom_namespace_uuid + ) generated_uuid = uuid.uuid5(namespace, name_string) else: raise ValueError("Invalid UUID type")