cmds.pkg.CmdSelect: Load path filter dynamically
The select command names PackageFilterString directly, but the filter is a spec string and the class is resolved dynamically by the loader. Build the filter through PathFilter.create() so the concrete class no longer appears at the call site. Signed-off-by: Jan Lindemann <jan@janware.com> Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.5.0
This commit is contained in:
parent
9197e51439
commit
685ed51935
1 changed files with 3 additions and 3 deletions
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, override
|
||||
|
||||
from ...lib.PackageFilter import PackageFilterString
|
||||
from ...lib.PathFilter import PathFilter
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -20,8 +20,8 @@ class CmdSelect(Cmd): # export
|
|||
|
||||
@override
|
||||
async def _run(self, args: Namespace) -> None:
|
||||
filter = PackageFilterString(
|
||||
file_context = self.app.exec_context, spec = args.filter
|
||||
filter = PathFilter.create(
|
||||
spec = args.filter, file_context = self.app.exec_context
|
||||
) if args.filter else None
|
||||
if filter is not None:
|
||||
from ...lib.PackageFilter import PackageFilter
|
||||
|
|
|
|||
Loading…
Reference in a new issue