xlwings-utils 25.1.3.post1__tar.gz → 25.1.3.post2__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.

Potentially problematic release.


This version of xlwings-utils might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xlwings_utils
3
- Version: 25.1.3.post1
3
+ Version: 25.1.3.post2
4
4
  Summary: xlwings_utils
5
5
  Author-email: Ruud van der Ham <rt.van.der.ham@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/salabim/xlwings_utils
@@ -10,7 +10,7 @@ authors = [
10
10
  { name = "Ruud van der Ham", email = "rt.van.der.ham@gmail.com" },
11
11
  ]
12
12
  description = "xlwings_utils"
13
- version = "25.1.3.post1"
13
+ version = "25.1.3.post2"
14
14
  readme = "README.md"
15
15
  requires-python = ">=3.9"
16
16
  dependencies = [
@@ -136,12 +136,18 @@ def list_dropbox(path="", recursive=False, show_files=True, show_folders=False):
136
136
  headers = {"Authorization": f"Bearer {_token}", "Content-Type": "application/json"}
137
137
  payload = {"path": str(path), "recursive": recursive, "include_deleted": False}
138
138
  response = requests.post("https://api.dropboxapi.com/2/files/list_folder", headers=headers, json=payload, timeout=30)
139
- response.raise_for_status()
139
+ try:
140
+ response.raise_for_status()
141
+ except requests.exceptions.HTTPError as e:
142
+ raise OSError(f"error listing dropbox. Original message is {e}") from None
140
143
  data = response.json()
141
144
  entries = data["entries"]
142
145
  while data.get("has_more"):
143
146
  response = requests.post(f"{API_RPC}/files/list_folder/continue", headers=headers, json={"cursor": data["cursor"]}, timeout=30)
144
- response.raise_for_status()
147
+ try:
148
+ response.raise_for_status()
149
+ except requests.exceptions.HTTPError as e:
150
+ raise OSError(f"error listing dropbox. Original message is {e}") from None
145
151
  data = response.json()
146
152
  entries.extend(data["entries"])
147
153
 
@@ -167,6 +173,10 @@ def read_dropbox(dropbox_path):
167
173
  -------
168
174
  contents of the dropbox file : bytes
169
175
 
176
+ Note
177
+ ----
178
+ If the file could not be read, an OSError will be raised.
179
+
170
180
  Note
171
181
  ----
172
182
  If REFRESH_TOKEN, APP_KEY and APP_SECRET environment variables are specified,
@@ -179,7 +189,7 @@ def read_dropbox(dropbox_path):
179
189
  try:
180
190
  response.raise_for_status()
181
191
  except requests.exceptions.HTTPError as e:
182
- raise FileNotFoundError(f"file {str(dropbox_path)} not found. Original message is {e}") from None
192
+ raise OSError(f"file {str(dropbox_path)} not found. Original message is {e}") from None
183
193
  chunks = []
184
194
  for chunk in response.iter_content(chunk_size=1024):
185
195
  if chunk:
@@ -199,6 +209,10 @@ def write_dropbox(dropbox_path, contents):
199
209
  contents : bytes
200
210
  contents to be written
201
211
 
212
+ Note
213
+ ----
214
+ If the file could not be written, an OSError will be raised.
215
+
202
216
  Note
203
217
  ----
204
218
  If REFRESH_TOKEN, APP_KEY and APP_SECRET environment variables are specified,
@@ -216,7 +230,7 @@ def write_dropbox(dropbox_path, contents):
216
230
  try:
217
231
  response.raise_for_status()
218
232
  except requests.exceptions.HTTPError as e:
219
- raise FileNotFoundError(f"file {str(dropbox_path)} could not be written. Original message is {e}") from None
233
+ raise OSError(f"file {str(dropbox_path)} could not be written. Original message is {e}") from None
220
234
  return response
221
235
 
222
236
 
@@ -229,6 +243,10 @@ def delete_from_dropbox(dropbox_path):
229
243
  dropbox_path : str or Pathlib.Path
230
244
  path to delete
231
245
 
246
+ Note
247
+ ----
248
+ If the file could not be deleted, an OSError will be raised.
249
+
232
250
  Note
233
251
  ----
234
252
  If REFRESH_TOKEN, APP_KEY and APP_SECRET environment variables are specified,
@@ -244,7 +262,8 @@ def delete_from_dropbox(dropbox_path):
244
262
  try:
245
263
  response.raise_for_status()
246
264
  except requests.exceptions.HTTPError as e:
247
- raise FileNotFoundError(f"file {str(dropbox_path)} could not be deleted. Original message is {e}") from None
265
+ raise OSError(f"file {str(dropbox_path)} could not be deleted. Original message is {e}") from None
266
+ return response
248
267
 
249
268
 
250
269
  def list_local(path, recursive=False, show_files=True, show_folders=False):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xlwings_utils
3
- Version: 25.1.3.post1
3
+ Version: 25.1.3.post2
4
4
  Summary: xlwings_utils
5
5
  Author-email: Ruud van der Ham <rt.van.der.ham@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/salabim/xlwings_utils