diff --git a/debian/control b/debian/control index 554619c..6bd21ed 100644 --- a/debian/control +++ b/debian/control @@ -1,47 +1,47 @@ Source: swh-indexer Maintainer: Software Heritage developers Section: python Priority: optional Build-Depends: debhelper (>= 9), dh-python (>= 2), python3-all, python3-chardet (>= 2.3.0~), python3-click, python3-nose, python3-pygments, python3-magic, python3-setuptools, - python3-swh.core (>= 0.0.37~), + python3-swh.core (>= 0.0.40~), python3-swh.model (>= 0.0.15~), python3-swh.objstorage (>= 0.0.13~), python3-swh.scheduler (>= 0.0.14~), python3-swh.storage (>= 0.0.100~), python3-vcversioner Standards-Version: 3.9.6 Homepage: https://forge.softwareheritage.org/diffusion/78/ Package: python3-swh.indexer.storage Architecture: all -Depends: python3-swh.core (>= 0.0.37~), +Depends: python3-swh.core (>= 0.0.40~), python3-swh.model (>= 0.0.15~), python3-swh.objstorage (>= 0.0.13~), python3-swh.scheduler (>= 0.0.14~), python3-swh.storage (>= 0.0.100~), ${misc:Depends}, ${python3:Depends} Description: Software Heritage Content Indexer Storage Package: python3-swh.indexer Architecture: all Depends: python3-swh.scheduler (>= 0.0.14~), - python3-swh.core (>= 0.0.37~), + python3-swh.core (>= 0.0.40~), python3-swh.model (>= 0.0.15~), python3-swh.objstorage (>= 0.0.13~), python3-swh.scheduler (>= 0.0.14~), python3-swh.storage (>= 0.0.100~), python3-swh.indexer.storage (= ${binary:Version}), universal-ctags (>= 0.8~), fossology-nomossa (>= 3.1~), ${misc:Depends}, ${python3:Depends} Description: Software Heritage Content Indexer diff --git a/requirements-swh.txt b/requirements-swh.txt index 4fc505d..264e313 100644 --- a/requirements-swh.txt +++ b/requirements-swh.txt @@ -1,5 +1,5 @@ -swh.core >= 0.0.37 +swh.core >= 0.0.40 swh.model >= 0.0.15 swh.objstorage >= 0.0.13 swh.scheduler >= 0.0.14 swh.storage >= 0.0.100 diff --git a/swh/indexer/storage/api/client.py b/swh/indexer/storage/api/client.py index e6a87a9..25268bb 100644 --- a/swh/indexer/storage/api/client.py +++ b/swh/indexer/storage/api/client.py @@ -1,100 +1,101 @@ -# Copyright (C) 2015-2017 The Software Heritage developers +# Copyright (C) 2015-2018 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information from swh.core.api import SWHRemoteAPI from swh.storage.exc import StorageAPIError class RemoteStorage(SWHRemoteAPI): """Proxy to a remote storage API""" - def __init__(self, url): - super().__init__(api_exception=StorageAPIError, url=url) + def __init__(self, url, timeout=None): + super().__init__( + api_exception=StorageAPIError, url=url, timeout=timeout) def check_config(self, *, check_write): return self.post('check_config', {'check_write': check_write}) def content_mimetype_add(self, mimetypes, conflict_update=False): return self.post('content_mimetype/add', { 'mimetypes': mimetypes, 'conflict_update': conflict_update, }) def content_mimetype_missing(self, mimetypes): return self.post('content_mimetype/missing', {'mimetypes': mimetypes}) def content_mimetype_get(self, ids): return self.post('content_mimetype', {'ids': ids}) def content_language_add(self, languages, conflict_update=False): return self.post('content_language/add', { 'languages': languages, 'conflict_update': conflict_update, }) def content_language_missing(self, languages): return self.post('content_language/missing', {'languages': languages}) def content_language_get(self, ids): return self.post('content_language', {'ids': ids}) def content_ctags_add(self, ctags, conflict_update=False): return self.post('content/ctags/add', { 'ctags': ctags, 'conflict_update': conflict_update, }) def content_ctags_missing(self, ctags): return self.post('content/ctags/missing', {'ctags': ctags}) def content_ctags_get(self, ids): return self.post('content/ctags', {'ids': ids}) def content_ctags_search(self, expression, limit=10, last_sha1=None): return self.post('content/ctags/search', { 'expression': expression, 'limit': limit, 'last_sha1': last_sha1, }) def content_fossology_license_add(self, licenses, conflict_update=False): return self.post('content/fossology_license/add', { 'licenses': licenses, 'conflict_update': conflict_update, }) def content_fossology_license_get(self, ids): return self.post('content/fossology_license', {'ids': ids}) def content_metadata_add(self, metadatas, conflict_update=False): return self.post('content_metadata/add', { 'metadatas': metadatas, 'conflict_update': conflict_update, }) def content_metadata_missing(self, metadatas): return self.post('content_metadata/missing', {'metadatas': metadatas}) def content_metadata_get(self, ids): return self.post('content_metadata', {'ids': ids}) def revision_metadata_add(self, metadatas, conflict_update=False): return self.post('revision_metadata/add', { 'metadatas': metadatas, 'conflict_update': conflict_update, }) def revision_metadata_missing(self, metadatas): return self.post('revision_metadata/missing', {'metadatas': metadatas}) def revision_metadata_get(self, ids): return self.post('revision_metadata', {'ids': ids}) def indexer_configuration_add(self, tools): return self.post('indexer_configuration/add', {'tools': tools}) def indexer_configuration_get(self, tool): return self.post('indexer_configuration/data', {'tool': tool})