sourceforge/lister: Add credentials parameter

The credentials parameter is not optional due to the instance constructor logic. Even if
unused, this must be provided to the lister (from the task standpoint).

Related to T3310#64801
This commit is contained in:
Antoine R. Dumont (@ardumont) 2021-05-07 16:10:11 +02:00
parent 3167a6dcb7
commit 7282647bb2
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8

View file

@ -20,7 +20,7 @@ from swh.scheduler.interface import SchedulerInterface
from swh.scheduler.model import ListedOrigin
from .. import USER_AGENT
from ..pattern import Lister
from ..pattern import CredentialsType, Lister
logger = logging.getLogger(__name__)
@ -108,9 +108,17 @@ class SourceForgeLister(Lister[SourceForgeListerState, SourceForgeListerPage]):
# Part of the lister API, that identifies this lister
LISTER_NAME = "sourceforge"
def __init__(self, scheduler: SchedulerInterface, incremental: bool = False):
def __init__(
self,
scheduler: SchedulerInterface,
incremental: bool = False,
credentials: Optional[CredentialsType] = None,
):
super().__init__(
scheduler=scheduler, url="https://sourceforge.net", instance="main"
scheduler=scheduler,
url="https://sourceforge.net",
instance="main",
credentials=credentials,
)
# Will hold the currently saved "last modified" dates to compare against our