feat: prompt plugins - remove some debug statements

Rafael Uzarowski committed Jun 2, 2025 at 21:11 UTC 557326650f8bad3abe8d2b7f1b900b1e0687a0cb
1 file changed -7
python/helpers/files.py
-7
@@ -29,39 +29,32 @@ def load_plugin_variables(file: str, backup_dirs: list[str] | None = None) -> di
29 backup_dirs = []
30
31 try:
32 - PrintStyle().debug(f"Loading prompt variables for {file}")
32 plugin_file = find_file_in_dirs(
33 get_abs_path(dirname(file), basename(file, ".md") + ".py"),
34 backup_dirs
35 )
36 except FileNotFoundError:
38 - PrintStyle().debug(f"No plugin file found: {get_abs_path(dirname(file), basename(file, '.md') + '.py')}")
37 plugin_file = None
38
39 if plugin_file and exists(plugin_file):
40 # load python code and extract variables variables from it
43 - PrintStyle().debug(f"Importing module from file: {plugin_file}")
41 module = None
42 module_name = dirname(plugin_file).replace("/", ".") + "." + basename(plugin_file, '.py')
43 try:
44 spec = importlib.util.spec_from_file_location(module_name, plugin_file)
45 if not spec:
49 - PrintStyle().debug(f"Module not found: {plugin_file} {module_name}")
46 return {}
47 module = importlib.util.module_from_spec(spec)
48 sys.modules[spec.name] = module
49 spec.loader.exec_module(module) # type: ignore
50 except ImportError:
55 - PrintStyle().debug(f"Module not found: {plugin_file} {module_name}")
51 return {}
52
53 if module is None:
59 - PrintStyle().debug(f"Module not found: {plugin_file} {module_name}")
54 return {}
55
56 # Get all classes in the module
57 class_list = inspect.getmembers(module, inspect.isclass)
64 - PrintStyle().debug(f"Found {len(class_list)} classes in module: {basename(plugin_file, '.py')}")
58 # Filter for classes that are subclasses of VariablesPlugin
59 # iterate backwards to skip imported superclasses
60 for cls in reversed(class_list):