diff --git a/debian/control b/debian/control index 998c410..573ef0d 100644 --- a/debian/control +++ b/debian/control @@ -1,25 +1,25 @@ Source: swh-archiver Maintainer: Software Heritage developers Section: python Priority: optional Build-Depends: debhelper (>= 9), dh-python (>= 2), python3-all, python3-click, python3-nose, python3-psycopg2, python3-setuptools, python3-swh.core (>= 0.0.44), - python3-swh.journal (>= 0.0.2), + python3-swh.journal (>= 0.0.5), python3-swh.model (>= 0.0.27), python3-swh.objstorage (>= 0.0.17), python3-swh.scheduler (>= 0.0.32), python3-swh.storage (>= 0.0.102), python3-vcversioner Standards-Version: 3.9.6 Homepage: https://forge.softwareheritage.org/source/swh-archiver/ Package: python3-swh.archiver Architecture: all Depends: ${misc:Depends}, ${python3:Depends} Description: Software Heritage Archiver diff --git a/requirements-swh.txt b/requirements-swh.txt index c578aa3..b0c6b74 100644 --- a/requirements-swh.txt +++ b/requirements-swh.txt @@ -1,6 +1,6 @@ swh.core >= 0.0.44 -swh.journal >= 0.0.2 +swh.journal >= 0.0.5 swh.model >= 0.0.27 swh.objstorage >= 0.0.17 swh.scheduler >= 0.0.32 swh.storage >= 0.0.102 diff --git a/swh/archiver/updater.py b/swh/archiver/updater.py index 64cf1ce..f2aa1d3 100644 --- a/swh/archiver/updater.py +++ b/swh/archiver/updater.py @@ -1,56 +1,56 @@ -# Copyright (C) 2017 The Software Heritage developers +# Copyright (C) 2017-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 import logging -from swh.journal.client import SWHJournalClient +from swh.journal.client import JournalClient from .storage import get_archiver_storage -class SWHArchiverContentUpdater(SWHJournalClient): +class ArchiverContentUpdater(JournalClient): """Client in charge of updating new contents in the content_archiver db. This is a swh.journal client only dealing with contents. """ CONFIG_BASE_FILENAME = 'archiver/content_updater' ADDITIONAL_CONFIG = { 'archiver_storage': ( 'dict', { 'cls': 'db', 'args': { 'dbconn': 'dbname=softwareheritage-archiver-dev ' 'user=guest', } }), 'sources_present': ('list[str]', ['uffizi']) } def __init__(self): # Only interested in content here so override the configuration super().__init__(extra_configuration={'object_types': ['content']}) self.sources_present = self.config['sources_present'] self.archiver_storage = get_archiver_storage( **self.config['archiver_storage']) def process_objects(self, messages): self.archiver_storage.content_archive_add( (c[b'sha1'] for c in messages['content']), self.sources_present) if __name__ == '__main__': logging.basicConfig( level=logging.INFO, format='%(asctime)s %(process)d %(levelname)s %(message)s' ) - content_updater = SWHArchiverContentUpdater() + content_updater = ArchiverContentUpdater() content_updater.process()