38
38
will be shared via emails or link.
39
39
"""
40
40
41
- from typing import Any , List , Optional , Union
41
+ from typing import Any , Dict , List , Optional , Union
42
42
import binascii
43
43
import functools
44
44
import hashlib
@@ -165,7 +165,7 @@ def download(url: str, file: str = "") -> None:
165
165
f .write (chunk )
166
166
167
167
168
- def _file_name_and_size (file : str ) -> dict [str , Union [int , str ]]:
168
+ def _file_name_and_size (file : str ) -> Dict [str , Union [int , str ]]:
169
169
"""Given a file, prepare the "item_type", "name" and "size" dictionary.
170
170
171
171
Return a dictionary with "item_type", "name" and "size" keys.
@@ -216,7 +216,7 @@ def _prepare_email_upload(
216
216
sender : str ,
217
217
recipients : List [str ],
218
218
session : requests .Session ,
219
- ) -> dict [Any , Any ]:
219
+ ) -> Dict [Any , Any ]:
220
220
"""Given a list of filenames, message a sender and recipients prepare for
221
221
the email upload.
222
222
@@ -237,7 +237,7 @@ def _prepare_email_upload(
237
237
238
238
def _verify_email_upload (
239
239
transfer_id : str , session : requests .Session
240
- ) -> dict [Any , Any ]:
240
+ ) -> Dict [Any , Any ]:
241
241
"""Given a transfer_id, read the code from standard input.
242
242
243
243
Return the parsed JSON response.
@@ -260,7 +260,7 @@ def _prepare_link_upload(
260
260
display_name : str ,
261
261
message : str ,
262
262
session : requests .Session ,
263
- ) -> dict [Any , Any ]:
263
+ ) -> Dict [Any , Any ]:
264
264
"""Given a list of filenames and a message prepare for the link upload.
265
265
266
266
Return the parsed JSON response.
@@ -278,7 +278,7 @@ def _prepare_link_upload(
278
278
279
279
def _storm_urls (
280
280
authorization : str ,
281
- ) -> dict [str , str ]:
281
+ ) -> Dict [str , str ]:
282
282
"""Given an authorization bearer extract storm URLs.
283
283
284
284
Return a dict with the various storm URLs.
@@ -299,7 +299,7 @@ def _storm_urls(
299
299
300
300
def _storm_preflight_item (
301
301
file : str ,
302
- ) -> dict [str , Union [List [dict [str , int ]], str ]]:
302
+ ) -> Dict [str , Union [List [Dict [str , int ]], str ]]:
303
303
"""Given a file, prepare the item block dictionary.
304
304
305
305
Return a dictionary with "blocks", "item_type" and "path" keys.
@@ -316,7 +316,7 @@ def _storm_preflight_item(
316
316
317
317
def _storm_preflight (
318
318
authorization : str , filenames : List [str ]
319
- ) -> dict [Any , Any ]:
319
+ ) -> Dict [Any , Any ]:
320
320
"""Given an Authorization token and filenames do preflight for upload.
321
321
322
322
Return the parsed JSON response.
@@ -355,7 +355,7 @@ def _md5(file: str) -> str:
355
355
return h .hexdigest ()
356
356
357
357
358
- def _storm_prepare_item (file : str ) -> dict [str , Union [int , str ]]:
358
+ def _storm_prepare_item (file : str ) -> Dict [str , Union [int , str ]]:
359
359
"""Given a file, prepare the block for blocks dictionary.
360
360
361
361
Return a dictionary with "content_length" and "content_md5_hex" keys.
@@ -365,7 +365,7 @@ def _storm_prepare_item(file: str) -> dict[str, Union[int, str]]:
365
365
return {"content_length" : filesize , "content_md5_hex" : _md5 (file )}
366
366
367
367
368
- def _storm_prepare (authorization : str , filenames : List [str ]) -> dict [Any , Any ]:
368
+ def _storm_prepare (authorization : str , filenames : List [str ]) -> Dict [Any , Any ]:
369
369
"""Given an Authorization token and filenames prepare for block uploads.
370
370
371
371
Return the parsed JSON response.
@@ -395,7 +395,7 @@ def _storm_prepare(authorization: str, filenames: List[str]) -> dict[Any, Any]:
395
395
396
396
def _storm_finalize_item (
397
397
file : str , block_id : str
398
- ) -> dict [str , Union [List [str ], str ]]:
398
+ ) -> Dict [str , Union [List [str ], str ]]:
399
399
"""Given a file and block_id prepare the item block dictionary.
400
400
401
401
Return a dictionary with "block_ids", "item_type" and "path" keys.
@@ -418,7 +418,7 @@ def _storm_finalize_item(
418
418
419
419
def _storm_finalize (
420
420
authorization : str , filenames : List [str ], block_ids : List [str ]
421
- ) -> dict [Any , Any ]:
421
+ ) -> Dict [Any , Any ]:
422
422
"""Given an Authorization token, filenames and block ids finalize upload.
423
423
424
424
Return the parsed JSON response.
@@ -494,7 +494,7 @@ def _storm_upload(url: str, file: str) -> None:
494
494
495
495
def _finalize_upload (
496
496
transfer_id : str , session : requests .Session
497
- ) -> dict [Any , Any ]:
497
+ ) -> Dict [Any , Any ]:
498
498
"""Given a transfer_id finalize the upload.
499
499
500
500
Return the parsed JSON response.
0 commit comments