Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8392922
manager.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
837 B
Subscribers
None
manager.py
View Options
#!/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
from
swh.loader.git.store
import
db
,
models
def
manage
(
action
,
db_url
):
"""According to action, load the repository.
used configuration keys:
- action: requested action [cleandb|initdb]
"""
with
db
.
connect
(
db_url
)
as
db_conn
:
if
action
==
'cleandb'
:
logging
.
info
(
'clean database'
)
models
.
cleandb
(
db_conn
)
elif
action
==
'initdb'
:
logging
.
info
(
'initialize database'
)
models
.
initdb
(
db_conn
)
else
:
logging
.
warn
(
'skip unknown-action
%s
'
%
action
)
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Jun 4 2025, 7:05 PM (10 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3398929
Attached To
rDLDG Git loader
Event Timeline
Log In to Comment