dsw-storage 4.21.0__tar.gz → 4.22.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dsw-storage
3
- Version: 4.21.0
3
+ Version: 4.22.0
4
4
  Summary: Library for managing DSW S3 storage
5
5
  Author-email: Marek Suchánek <marek.suchanek@ds-wizard.org>
6
6
  License: Apache License 2.0
@@ -20,7 +20,7 @@ Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
21
  Requires-Dist: minio
22
22
  Requires-Dist: tenacity
23
- Requires-Dist: dsw-config==4.21.0
23
+ Requires-Dist: dsw-config==4.22.0
24
24
  Dynamic: license-file
25
25
 
26
26
  # Data Stewardship Wizard: Storage
@@ -9,9 +9,9 @@ BuildInfo = namedtuple(
9
9
  )
10
10
 
11
11
  BUILD_INFO = BuildInfo(
12
- version='v4.21.0~12713f1',
13
- built_at='2025-08-05 09:20:46Z',
14
- sha='12713f1988c2a33d5c40dd2cb899cdac7be35668',
12
+ version='v4.22.0~dffe6c1',
13
+ built_at='2025-09-02 13:01:16Z',
14
+ sha='dffe6c10e47b8795a0d27d495d1c0c0a5d4a76fb',
15
15
  branch='HEAD',
16
- tag='v4.21.0',
16
+ tag='v4.22.0',
17
17
  )
@@ -91,7 +91,55 @@ class S3Storage:
91
91
  before=tenacity.before_log(LOG, logging.DEBUG),
92
92
  after=tenacity.after_log(LOG, logging.DEBUG),
93
93
  )
94
- def download_file(self, *, file_name: str, target_path: pathlib.Path) -> bool:
94
+ def download_questionnaire_file(self, *, tenant_uuid: str, questionnaire_uuid: str,
95
+ file_uuid: str, target_path: pathlib.Path) -> bool:
96
+ return self._download_file(
97
+ tenant_uuid=tenant_uuid,
98
+ file_name=f'questionnaire-files/{questionnaire_uuid}/{file_uuid}',
99
+ target_path=target_path,
100
+ )
101
+
102
+ @tenacity.retry(
103
+ reraise=True,
104
+ wait=tenacity.wait_exponential(multiplier=RETRY_S3_MULTIPLIER),
105
+ stop=tenacity.stop_after_attempt(RETRY_S3_TRIES),
106
+ before=tenacity.before_log(LOG, logging.DEBUG),
107
+ after=tenacity.after_log(LOG, logging.DEBUG),
108
+ )
109
+ def download_template_asset(self, *, tenant_uuid: str, template_id: str,
110
+ file_name: str, target_path: pathlib.Path) -> bool:
111
+ return self._download_file(
112
+ tenant_uuid=tenant_uuid,
113
+ file_name=f'templates/{template_id}/{file_name}',
114
+ target_path=target_path,
115
+ )
116
+
117
+ @tenacity.retry(
118
+ reraise=True,
119
+ wait=tenacity.wait_exponential(multiplier=RETRY_S3_MULTIPLIER),
120
+ stop=tenacity.stop_after_attempt(RETRY_S3_TRIES),
121
+ before=tenacity.before_log(LOG, logging.DEBUG),
122
+ after=tenacity.after_log(LOG, logging.DEBUG),
123
+ )
124
+ def download_locale(self, *, tenant_uuid: str, locale_id: str,
125
+ file_name: str, target_path: pathlib.Path) -> bool:
126
+ return self._download_file(
127
+ tenant_uuid=tenant_uuid,
128
+ file_name=f'locales/{locale_id}/{file_name}',
129
+ target_path=target_path,
130
+ )
131
+
132
+ @tenacity.retry(
133
+ reraise=True,
134
+ wait=tenacity.wait_exponential(multiplier=RETRY_S3_MULTIPLIER),
135
+ stop=tenacity.stop_after_attempt(RETRY_S3_TRIES),
136
+ before=tenacity.before_log(LOG, logging.DEBUG),
137
+ after=tenacity.after_log(LOG, logging.DEBUG),
138
+ )
139
+ def _download_file(self, *, tenant_uuid: str, file_name: str,
140
+ target_path: pathlib.Path) -> bool:
141
+ if self.multi_tenant:
142
+ file_name = f'{tenant_uuid}/{file_name}'
95
143
  try:
96
144
  self.client.fget_object(
97
145
  bucket_name=self.cfg.bucket,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dsw-storage
3
- Version: 4.21.0
3
+ Version: 4.22.0
4
4
  Summary: Library for managing DSW S3 storage
5
5
  Author-email: Marek Suchánek <marek.suchanek@ds-wizard.org>
6
6
  License: Apache License 2.0
@@ -20,7 +20,7 @@ Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
21
  Requires-Dist: minio
22
22
  Requires-Dist: tenacity
23
- Requires-Dist: dsw-config==4.21.0
23
+ Requires-Dist: dsw-config==4.22.0
24
24
  Dynamic: license-file
25
25
 
26
26
  # Data Stewardship Wizard: Storage
@@ -0,0 +1,3 @@
1
+ minio
2
+ tenacity
3
+ dsw-config==4.22.0
@@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'
4
4
 
5
5
  [project]
6
6
  name = 'dsw-storage'
7
- version = "4.21.0"
7
+ version = "4.22.0"
8
8
  description = 'Library for managing DSW S3 storage'
9
9
  readme = 'README.md'
10
10
  keywords = ['dsw', 's3', 'bucket', 'storage']
@@ -26,7 +26,7 @@ dependencies = [
26
26
  'minio',
27
27
  'tenacity',
28
28
  # DSW
29
- "dsw-config==4.21.0",
29
+ "dsw-config==4.22.0",
30
30
  ]
31
31
 
32
32
  [project.urls]
@@ -1,3 +0,0 @@
1
- minio
2
- tenacity
3
- dsw-config==4.21.0
File without changes
File without changes
File without changes
File without changes