|
11 | 11 | from pprint import pprint, pformat |
12 | 12 | from datetime import datetime |
13 | 13 | from frameioclient import FrameioClient, Utils, KB, MB |
| 14 | +from frameioclient.lib.utils import FormatTypes |
14 | 15 |
|
15 | 16 | token = os.getenv("FRAMEIO_TOKEN") # Your Frame.io token |
16 | 17 | project_id = os.getenv("PROJECT_ID") # Project you want to upload files back into |
@@ -109,7 +110,7 @@ def test_download(client: FrameioClient, override=False): |
109 | 110 | client.assets.download(asset, download_dir, multi_part=True) |
110 | 111 |
|
111 | 112 | download_time = time.time() - start_time |
112 | | - download_speed = Utils.format_value(ceil(asset['filesize']/(download_time))) |
| 113 | + download_speed = Utils.format_value(ceil(asset['filesize']/(download_time)), type=FormatTypes.SPEED) |
113 | 114 |
|
114 | 115 | print("{}/{} Download completed in {:.2f}s @ {}".format((count), len(asset_list), download_time, download_speed)) |
115 | 116 |
|
@@ -153,7 +154,7 @@ def test_upload(client: FrameioClient): |
153 | 154 | client.assets.upload(new_parent_id, ul_abs_path) |
154 | 155 |
|
155 | 156 | upload_time = time.time() - start_time |
156 | | - upload_speed = Utils.format_value(ceil(filesize/(upload_time))) |
| 157 | + upload_speed = Utils.format_value(ceil(filesize/(upload_time)), type=FormatTypes.SPEED) |
157 | 158 |
|
158 | 159 | print("{}/{} Upload completed in {:.2f}s @ {}".format((count), len(dled_files), upload_time, upload_speed)) |
159 | 160 |
|
|
0 commit comments