Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9337092
swh-loader-git
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
957 B
Subscribers
None
swh-loader-git
View Options
#!/usr/bin/env python3
import
logging
import
sys
from
swh.core.logger
import
PostgresHandler
from
swh.loader.git
import
BulkLoader
ADDITIONAL_CONFIG
=
{
'repo_path'
:
(
'str'
,
None
),
'origin_url'
:
(
'str'
,
'file:///dev/null'
),
'authority'
:
(
'int'
,
1
),
'validity'
:
(
'str'
,
'2015-01-01 00:00:00+00'
),
}
my_config
=
BulkLoader
.
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
=
BulkLoader
(
my_config
)
loader
.
process
(
my_config
[
'repo_path'
],
my_config
[
'origin_url'
],
my_config
[
'authority'
],
my_config
[
'validity'
])
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Jul 4 2025, 7:53 AM (10 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3446623
Attached To
rDLDG Git loader
Event Timeline
Log In to Comment