synapse-sdk 1.0.0a67__py3-none-any.whl → 1.0.0a68__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of synapse-sdk might be problematic. Click here for more details.
- synapse_sdk/utils/storage/__init__.py +3 -30
- {synapse_sdk-1.0.0a67.dist-info → synapse_sdk-1.0.0a68.dist-info}/METADATA +1 -1
- {synapse_sdk-1.0.0a67.dist-info → synapse_sdk-1.0.0a68.dist-info}/RECORD +7 -7
- {synapse_sdk-1.0.0a67.dist-info → synapse_sdk-1.0.0a68.dist-info}/WHEEL +0 -0
- {synapse_sdk-1.0.0a67.dist-info → synapse_sdk-1.0.0a68.dist-info}/entry_points.txt +0 -0
- {synapse_sdk-1.0.0a67.dist-info → synapse_sdk-1.0.0a68.dist-info}/licenses/LICENSE +0 -0
- {synapse_sdk-1.0.0a67.dist-info → synapse_sdk-1.0.0a68.dist-info}/top_level.txt +0 -0
|
@@ -14,40 +14,13 @@ def get_storage(connection_param: str | dict):
|
|
|
14
14
|
Returns:
|
|
15
15
|
BaseStorage: The storage class object with connection param.
|
|
16
16
|
"""
|
|
17
|
-
if connection_param is None:
|
|
18
|
-
raise ValueError(_('Connection parameter cannot be None'))
|
|
19
|
-
|
|
20
17
|
storage_scheme = None
|
|
21
18
|
if isinstance(connection_param, dict):
|
|
22
|
-
|
|
23
|
-
raise ValueError(_('Connection parameter dictionary cannot be empty'))
|
|
24
|
-
|
|
25
|
-
# Check if there's a URL field that should take priority
|
|
26
|
-
if 'url' in connection_param and connection_param['url']:
|
|
27
|
-
storage_scheme = urlparse(connection_param['url']).scheme
|
|
28
|
-
elif 'provider' in connection_param:
|
|
29
|
-
storage_scheme = connection_param['provider']
|
|
30
|
-
if not storage_scheme:
|
|
31
|
-
raise ValueError(_('Provider name cannot be empty'))
|
|
32
|
-
else:
|
|
33
|
-
raise ValueError(_('Dictionary must contain either "url" or "provider" field'))
|
|
34
|
-
elif isinstance(connection_param, str):
|
|
35
|
-
if not connection_param or connection_param.isspace():
|
|
36
|
-
raise ValueError(_('Connection parameter string cannot be empty'))
|
|
37
|
-
|
|
38
|
-
parsed_url = urlparse(connection_param)
|
|
39
|
-
storage_scheme = parsed_url.scheme
|
|
40
|
-
if not storage_scheme:
|
|
41
|
-
raise ValueError(_('Invalid URL format: no scheme found'))
|
|
19
|
+
storage_scheme = connection_param['provider']
|
|
42
20
|
else:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if storage_scheme not in STORAGE_PROVIDERS:
|
|
46
|
-
supported_schemes = ', '.join(STORAGE_PROVIDERS.keys())
|
|
47
|
-
raise ValueError(
|
|
48
|
-
_('Storage provider "{}" not supported. Supported providers: {}').format(storage_scheme, supported_schemes)
|
|
49
|
-
)
|
|
21
|
+
storage_scheme = urlparse(connection_param).scheme
|
|
50
22
|
|
|
23
|
+
assert storage_scheme in STORAGE_PROVIDERS.keys(), _('Storage provider not supported.')
|
|
51
24
|
return STORAGE_PROVIDERS[storage_scheme](connection_param)
|
|
52
25
|
|
|
53
26
|
|
|
@@ -200,16 +200,16 @@ synapse_sdk/utils/pydantic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
|
200
200
|
synapse_sdk/utils/pydantic/config.py,sha256=1vYOcUI35GslfD1rrqhFkNXXJOXt4IDqOPSx9VWGfNE,123
|
|
201
201
|
synapse_sdk/utils/pydantic/errors.py,sha256=0v0T12eQBr1KrFiEOBu6KMaPK4aPEGEC6etPJGoR5b4,1061
|
|
202
202
|
synapse_sdk/utils/pydantic/validators.py,sha256=G47P8ObPhsePmd_QZDK8EdPnik2CbaYzr_N4Z6En8dc,193
|
|
203
|
-
synapse_sdk/utils/storage/__init__.py,sha256=
|
|
203
|
+
synapse_sdk/utils/storage/__init__.py,sha256=HmZHqvoV-EogV2bE-Sw5XQRlrNuf3gfNL9irAJeRYsA,2195
|
|
204
204
|
synapse_sdk/utils/storage/registry.py,sha256=MNhX2ohVfQsjhuHO2YMn0wiJIA0ELPp5NXH8LWoh2bQ,473
|
|
205
205
|
synapse_sdk/utils/storage/providers/__init__.py,sha256=x7RGwZryT2FpVxS7fGWryRVpquHzAiIfTz-9uLgjleo,1860
|
|
206
206
|
synapse_sdk/utils/storage/providers/gcp.py,sha256=i2BQCu1Kej1If9SuNr2_lEyTcr5M_ncGITZrL0u5wEA,363
|
|
207
207
|
synapse_sdk/utils/storage/providers/http.py,sha256=2DhIulND47JOnS5ZY7MZUex7Su3peAPksGo1Wwg07L4,5828
|
|
208
208
|
synapse_sdk/utils/storage/providers/s3.py,sha256=W94rQvhGRXti3R4mYP7gmU5pcyCQpGFIBLvxxqLVdRM,2231
|
|
209
209
|
synapse_sdk/utils/storage/providers/sftp.py,sha256=_8s9hf0JXIO21gvm-JVS00FbLsbtvly4c-ETLRax68A,1426
|
|
210
|
-
synapse_sdk-1.0.
|
|
211
|
-
synapse_sdk-1.0.
|
|
212
|
-
synapse_sdk-1.0.
|
|
213
|
-
synapse_sdk-1.0.
|
|
214
|
-
synapse_sdk-1.0.
|
|
215
|
-
synapse_sdk-1.0.
|
|
210
|
+
synapse_sdk-1.0.0a68.dist-info/licenses/LICENSE,sha256=bKzmC5YAg4V1Fhl8OO_tqY8j62hgdncAkN7VrdjmrGk,1101
|
|
211
|
+
synapse_sdk-1.0.0a68.dist-info/METADATA,sha256=NsAlJYdIVUZnPNoHHrV2MGNIl7VNBWCY6kxibcastp4,1130
|
|
212
|
+
synapse_sdk-1.0.0a68.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
213
|
+
synapse_sdk-1.0.0a68.dist-info/entry_points.txt,sha256=VNptJoGoNJI8yLXfBmhgUefMsmGI0m3-0YoMvrOgbxo,48
|
|
214
|
+
synapse_sdk-1.0.0a68.dist-info/top_level.txt,sha256=ytgJMRK1slVOKUpgcw3LEyHHP7S34J6n_gJzdkcSsw8,12
|
|
215
|
+
synapse_sdk-1.0.0a68.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|