try vscode plugin

This commit is contained in:
CakeCN
2025-09-11 01:06:14 +08:00
parent 2da2da1208
commit 3109cc94e2
16 changed files with 481 additions and 35 deletions

View File

@@ -0,0 +1,18 @@
from typing import Callable
class FunctionManager:
def __init__(self):
self.function_caller = {}
self.function_predifine_args = {}
def add_function(self, function:Callable, predifine_args:dict):
self.function_caller[function.__name__] = function
self.function_predifine_args[function.__name__] = predifine_args
def get_function(self, function_name:str):
return self.function_caller[function_name]
def get_function_predifine_args(self, function_name:str):
return self.function_predifine_args[function_name]
def call_function(self, function_name:str, args:dict):
return self.function_caller[function_name]( **args, **self.function_predifine_args[function_name])