Page MenuHomeSoftware Heritage

D1930.id6500.diff
No OneTemporary

D1930.id6500.diff

diff --git a/swh/lister/core/indexing_lister.py b/swh/lister/core/indexing_lister.py
--- a/swh/lister/core/indexing_lister.py
+++ b/swh/lister/core/indexing_lister.py
@@ -245,5 +245,5 @@
"""Convenience class for ensuring right lookup and init order
when combining IndexingLister and ListerHttpTransport."""
def __init__(self, api_baseurl=None, override_config=None):
- ListerHttpTransport.__init__(self, api_baseurl=api_baseurl)
IndexingLister.__init__(self, override_config=override_config)
+ ListerHttpTransport.__init__(self, api_baseurl=api_baseurl)
diff --git a/swh/lister/core/lister_transports.py b/swh/lister/core/lister_transports.py
--- a/swh/lister/core/lister_transports.py
+++ b/swh/lister/core/lister_transports.py
@@ -29,7 +29,7 @@
To be used in conjunction with ListerBase or a subclass of it.
"""
-
+ DEFAULT_URL = None
PATH_TEMPLATE = AbstractAttribute('string containing a python string'
' format pattern that produces the API'
' endpoint path for listing stored'
@@ -143,6 +143,10 @@
return False, 0
def __init__(self, api_baseurl=None):
+ if not api_baseurl:
+ api_baseurl = self.config.get('api_baseurl')
+ if not api_baseurl:
+ api_baseurl = self.DEFAULT_URL
if not api_baseurl:
raise NameError('HTTP Lister Transport requires api_baseurl.')
self.api_baseurl = api_baseurl # eg. 'https://api.github.com'
diff --git a/swh/lister/core/page_by_page_lister.py b/swh/lister/core/page_by_page_lister.py
--- a/swh/lister/core/page_by_page_lister.py
+++ b/swh/lister/core/page_by_page_lister.py
@@ -156,5 +156,5 @@
"""
def __init__(self, api_baseurl=None, override_config=None):
- ListerHttpTransport.__init__(self, api_baseurl=api_baseurl)
PageByPageLister.__init__(self, override_config=override_config)
+ ListerHttpTransport.__init__(self, api_baseurl=api_baseurl)

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 18, 4:37 PM (4 h, 22 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3216398

Event Timeline