Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-loader-tar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Platform
Development
swh-loader-tar
Commits
228ec385
Verified
Commit
228ec385
authored
6 years ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
loader: Only explicit needed params & adapt docstring accordingly
parent
7ce28b6d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!16
tar.loader: Make the loader-tar able to download remote artifact
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/loader/tar/loader.py
+11
-7
11 additions, 7 deletions
swh/loader/tar/loader.py
with
11 additions
and
7 deletions
swh/loader/tar/loader.py
+
11
−
7
View file @
228ec385
...
...
@@ -157,6 +157,15 @@ class BaseTarLoader(BufferedLoader):
shutil
.
rmtree
(
self
.
temp_directory
)
def
prepare_origin_visit
(
self
,
*
,
origin
,
visit_date
=
None
,
**
kwargs
):
"""
Prepare the origin visit information.
Args:
origin (dict): Dict with keys {url, type}
visit_date (str): Date representing the date of the
visit. None by default will make it the current time
during the loading process.
"""
self
.
origin
=
origin
if
'
type
'
not
in
self
.
origin
:
# let the type flow if present
self
.
origin
[
'
type
'
]
=
'
tar
'
...
...
@@ -219,7 +228,7 @@ class RemoteTarLoader(BaseTarLoader):
- clean up the temporary location
"""
def
prepare
(
self
,
*
,
origin
,
last_modified
,
visit_date
=
None
):
def
prepare
(
self
,
*
,
last_modified
,
**
kwargs
):
"""
last_modified is the time of last modification of the tarball.
E.g https://ftp.gnu.org/gnu/8sync/:
...
...
@@ -284,20 +293,15 @@ class LegacyLocalTarLoader(BaseTarLoader):
- clean up the temporary location
"""
def
prepare
(
self
,
*
,
tar_path
,
origin
,
revision
,
branch_name
,
visit_date
=
None
):
def
prepare
(
self
,
*
,
tar_path
,
revision
,
branch_name
,
**
kwargs
):
"""
Prepare the data prior to ingest it in SWH archive.
Args:
tar_path (str): Path to the archive to ingest
origin (dict): Dict with keys {url, type}
revision (dict): The synthetic revision to associate the
archive to (no identifiers within)
branch_name (str): The branch name to use for the
snapshot.
visit_date (str): Date representing the date of the
visit. None by default will make it the current time
during the loading process.
"""
self
.
tar_path
=
tar_path
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment