Skip to content

Commit b406aa4

Browse files
committed
Skip socket base module in processor scan
Update processor package discovery to ignore `dlc_processor_socket` during namespace scanning, since it only provides the base class/registry and should not be listed as an available processor source. The package fallback scan now uses default class discovery behavior, and related outdated comments/docstring lines were cleaned up.
1 parent 72318d5 commit b406aa4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

dlclivegui/processors/processor_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ def scan_processor_folder(folder_path):
101101
def scan_processor_package(package_name: str = "dlclivegui.processors") -> dict[str | dict]:
102102
"""
103103
Discover and load processor classes from a package namespace.
104-
Returns a dict keyed as 'module.py::ClassName' with the same
105-
structure you use today.
106104
"""
107105
all_processors: dict[str, dict] = {}
108106

@@ -118,13 +116,16 @@ def scan_processor_package(package_name: str = "dlclivegui.processors") -> dict[
118116
continue
119117
try:
120118
mod = import_module(mod_name)
119+
# Skip dlc_processor_socket.py as it's the base class and registry
120+
if mod.__name__.endswith("dlc_processor_socket"):
121+
continue
121122

122123
# Prefer module-level registry function if present
123124
if hasattr(mod, "get_available_processors"):
124125
processors = mod.get_available_processors()
125126
else:
126127
# Fallback: scan for dlclive.Processor subclasses
127-
processors = discover_processor_classes(mod, only_defined_in_module=False)
128+
processors = discover_processor_classes(mod)
128129

129130
# Normalize into your “file::class” shape
130131
module_file = mod.__name__.split(".")[-1] + ".py"
@@ -175,7 +176,6 @@ def load_processors_from_file(file_path: str | Path):
175176
return processors
176177

177178
# Fallback path: discover subclasses of dlclive.Processor
178-
# here module only is disabled to allow classes re-exported in other modules to be discovered
179179
return discover_processor_classes(module, only_defined_in_module=False)
180180

181181
except Exception:

0 commit comments

Comments
 (0)