From e765c77f63902362fa249db992ca3453b108dc72 Mon Sep 17 00:00:00 2001 From: Tasha Upchurch Date: Fri, 7 Jul 2023 02:27:53 -0400 Subject: [PATCH] Added a new class `PublicGitRepo` with a method `validate_git_repo_url` that parses a git URL using `giturlparse`. --- git.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/git.py b/git.py index 95ac6b8..daa3440 100644 --- a/git.py +++ b/git.py @@ -1 +1,23 @@ -pip install gitpython +import giturlparse + +class PublicGitRepo: + """replaces the text in the given text string with a given other text at some key positions""" + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "url": ("STRING", {"multiline": False}), # Added url input + "email": ("STRING", {"multiline": False}) # Added email input + } + } + + CATEGORY = "text" + RETURN_TYPES = ("STRING",) + FUNCTION = "validate_git_repo_url" + + def validate_git_repo_url(self,**kwargs): + git_url = kwargs.get("url", None) + parsed_url = giturlparse.parse(git_url) + + return (git_url,)