Page MenuHomeSoftware Heritage

D4700.id16665.diff
No OneTemporary

D4700.id16665.diff

diff --git a/swh/lister/pattern.py b/swh/lister/pattern.py
--- a/swh/lister/pattern.py
+++ b/swh/lister/pattern.py
@@ -6,6 +6,7 @@
from dataclasses import dataclass
from typing import Any, Dict, Generic, Iterable, Iterator, List, Optional, TypeVar
+from swh.core.config import load_from_envvar
from swh.scheduler import get_scheduler, model
from swh.scheduler.interface import SchedulerInterface
@@ -246,3 +247,14 @@
scheduler_instance = get_scheduler(**scheduler)
return cls(scheduler=scheduler_instance, **config)
+
+ @classmethod
+ def from_configfile(cls, **kwargs: Any):
+ """Instantiate a lister from the configuration loaded from the
+ SWH_CONFIG_FILENAME envvar, with potential extra keyword arguments.
+
+ Args:
+ kwargs: kwargs passed to the lister instantiation
+ """
+ config = load_from_envvar()
+ return cls.from_config(**config, **kwargs)

File Metadata

Mime Type
text/plain
Expires
Nov 5 2024, 12:47 PM (12 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3222448

Event Timeline