[repro/class] provides with repros with args and kwargs
This commit is contained in:
parent
02911e57f8
commit
75619cf1c8
@ -22,9 +22,7 @@ class Repro:
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
def run_repro(
|
||||
self, nix_file: nix.File, name: str, file: pathlib.Path, *args, **kwargs
|
||||
) -> None:
|
||||
def run_repro(self, name: str, file: pathlib.Path, *args, **kwargs) -> None:
|
||||
spec = importlib.util.spec_from_file_location("rep", file)
|
||||
if not spec:
|
||||
log.error("Could not load the file")
|
||||
@ -40,7 +38,7 @@ class Repro:
|
||||
log.error(f"{spec.loader} is None")
|
||||
if hasattr(module, name):
|
||||
rep_class = getattr(module, name)
|
||||
rep_class.run(nix_file)
|
||||
rep_class.run(*args, **kwargs)
|
||||
else:
|
||||
raise AttributeError(f"{file.name} has no {name} class")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user