diff --git a/tools/python/jwutils/misc.py b/tools/python/jwutils/misc.py index 60c109e..ca11e4a 100644 --- a/tools/python/jwutils/misc.py +++ b/tools/python/jwutils/misc.py @@ -105,6 +105,10 @@ def load_class_names(path, baseclass, flt=None, remove_flt=False): # export def load_object(module_path, baseclass, class_name_filter=None, *args, **kwargs): # export return load_class(module_path, baseclass, class_name_filter=class_name_filter)(*args, **kwargs) +def load_function(module_path, name): # export + mod = importlib.import_module(module_path) + return getattr(mod, name) + def commit_tmpfile(tmp: str, path: str) -> None: # export caller = log.get_caller_pos() if os.path.isfile(path) and filecmp.cmp(tmp, path):