diff --git a/bin/swh-loader-dir b/bin/swh-loader-dir index 9bed9d6..4040fb9 100755 --- a/bin/swh-loader-dir +++ b/bin/swh-loader-dir @@ -1,56 +1,53 @@ #!/usr/bin/env python3 # Copyright (C) 2015 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 import sys from swh.core.logger import PostgresHandler -from swh.loader.dir import DirLoader +from swh.loader.dir.loader import DirLoader ADDITIONAL_CONFIG = { - 'dir_path': ('str', None), - # origin information 'origin_url': ('str', 'file:///dev/null'), # occurrence information 'branch': ('str', 'master'), - 'authority': ('int', 1), + 'authority_id': ('int', 1), 'validity': ('str', '2015-01-01 00:00:00+00'), # revision information 'revision_author_name': ('str', 'swh author'), 'revision_author_email': ('str', 'swh@inria.fr'), 'revision_author_date': ('str', '1444054085'), 'revision_author_offset': ('str', '+0200'), 'revision_committer_name': ('str', 'swh committer'), 'revision_committer_email': ('str', 'swh@inria.fr'), 'revision_committer_date': ('str', '1444054085'), 'revision_committer_offset': ('str', '+0200'), 'revision_type': ('str', 'dir'), 'revision_message': ('str', 'synthetic revision message'), } my_config = DirLoader.parse_config_file(config_filename=sys.argv[1], additional_configs=[ADDITIONAL_CONFIG]) logging.basicConfig( level=logging.DEBUG, format='%(asctime)s %(name)s %(levelname)s %(message)s', handlers=[ logging.StreamHandler(), PostgresHandler(my_config['log_db']), ], ) requests_log = logging.getLogger("requests") requests_log.setLevel(logging.CRITICAL) - loader = DirLoader(my_config) loader.process(my_config['dir_path']) diff --git a/resources/test/loader-dir.ini b/resources/test/loader-dir.ini index c634d10..95a1d97 100644 --- a/resources/test/loader-dir.ini +++ b/resources/test/loader-dir.ini @@ -1,17 +1,17 @@ [main] dir_path = /home/tony/tmp2 origin_url = file:///dev/null branch = master -authority = 1 +authority_id = 1 validity = 2015-01-01 00:00:00+00 revision_author_name = swh author revision_author_email = swh@inria.fr revision_author_date = 1444054085 revision_author_offset = +0200 revision_committer_name = swh committer revision_committer_email = swh@inria.fr revision_committer_date = 1444054085 revision_committer_offset = +0200 revision_type = dir revision_message = synthetic revision message