diff --git a/swh/lister/cgit/lister.py b/swh/lister/cgit/lister.py --- a/swh/lister/cgit/lister.py +++ b/swh/lister/cgit/lister.py @@ -2,11 +2,14 @@ # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information +from datetime import datetime import logging -from typing import Iterator, List, Optional +import re +from typing import Any, Dict, Iterator, List, Optional from urllib.parse import urljoin, urlparse from bs4 import BeautifulSoup +from iso8601 import ParseError, parse_date import requests from swh.lister import USER_AGENT @@ -16,7 +19,41 @@ logger = logging.getLogger(__name__) -Repositories = List[str] +Repositories = List[Dict[str, Any]] + +DATE_PATTERN = re.compile( + r"^(?P[0-9-:]+) (?P