Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7450901
__init__.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
782 B
Subscribers
None
__init__.py
View Options
from
.
import
storage
Storage
=
storage
.
Storage
def
get_storage
(
storage_class
,
storage_args
):
"""
Get a storage object of class `storage_class` with arguments
`storage_args`.
Args:
storage_class: one of 'remote_storage', 'local_storage'
storage_args: the arguments to pass to the storage class
Returns:
an instance of swh.storage.Storage (either local or remote)
Raises:
ValueError if passed an unknown storage_class.
"""
if
storage_class
==
'remote_storage'
:
from
.api.client
import
RemoteStorage
as
Storage
elif
storage_class
==
'local_storage'
:
from
.storage
import
Storage
else
:
raise
ValueError
(
'Unknown storage class `
%s
`'
%
storage_class
)
return
Storage
(
*
storage_args
)
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Thu, Apr 17, 9:05 AM (1 d, 20 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3239681
Attached To
rDSTOC swh-storage-cassandra
Event Timeline
Log In to Comment