@@ -13,8 +13,11 @@ def folder(folder_path, project_id):
1313 """Bulk upload files to a specified project."""
1414
1515 # Get the list of files to upload
16- files = [f for f in os .listdir (folder_path )
17- if os .path .isfile (os .path .join (folder_path , f ))]
16+ files = [
17+ f
18+ for f in os .listdir (folder_path )
19+ if os .path .isfile (os .path .join (folder_path , f ))
20+ ]
1821 total_files = len (files )
1922
2023 if total_files == 0 :
@@ -27,8 +30,7 @@ def folder(folder_path, project_id):
2730 api_url = user_settings .api_url
2831
2932 if not api_key or not api_url :
30- click .echo ("You are not logged in. "
31- "Please log in using the `login` command." )
33+ click .echo ("You are not logged in. " "Please log in using the `login` command." )
3234 return
3335
3436 # Initialize the API client
@@ -45,8 +47,7 @@ def folder(folder_path, project_id):
4547 project = client .project (project_id )
4648 click .echo (f"Retrieved project: { project .name } " )
4749 except Exception as e :
48- click .echo (f"Error: Unable to retrieve "
49- f"project with ID '{ project_id } '. { e } " )
50+ click .echo (f"Error: Unable to retrieve " f"project with ID '{ project_id } '. { e } " )
5051 return
5152
5253 # Display available dataset
@@ -65,13 +66,20 @@ def folder(folder_path, project_id):
6566 )
6667 if 1 <= choice <= len (datasets ):
6768 selected_dataset = datasets [choice - 1 ]
68- click .echo (f"Selected Dataset: { selected_dataset .name } (ID: { selected_dataset .id } " )
69+ click .echo (
70+ f"Selected Dataset: { selected_dataset .name } (ID: { selected_dataset .id } "
71+ )
6972 else :
70- click .echo (f"Invalid choice. Please select a number between 1 and { len (datasets )} " )
73+ click .echo (
74+ f"Invalid choice. Please select a number between 1 and { len (datasets )} "
75+ )
7176 else :
7277 # No datasets found, as if user want to continue with global upload
73- continue_upload = click .confirm ("No datasets found for this project"
74- "Do you want to continue with global upload?" , default = False )
78+ continue_upload = click .confirm (
79+ "No datasets found for this project"
80+ "Do you want to continue with global upload?" ,
81+ default = False ,
82+ )
7583 if not continue_upload :
7684 click .echo ("Ending..." )
7785 return
@@ -88,8 +96,7 @@ def folder(folder_path, project_id):
8896
8997 click .echo ("\n Available Storages:" )
9098 for idx , storage_link in enumerate (storage_links ):
91- click .echo (f"{ idx + 1 } . { storage_link .name } "
92- f"(ID: { storage_link .id } )" )
99+ click .echo (f"{ idx + 1 } . { storage_link .name } " f"(ID: { storage_link .id } )" )
93100
94101 # Prompt user to select a storage link
95102 choice = click .prompt (
@@ -100,11 +107,15 @@ def folder(folder_path, project_id):
100107 if 1 <= choice <= len (storage_links ):
101108 selected_storage_link = storage_links [choice - 1 ]
102109 else :
103- click .echo (f"Invalid choice. Please select a number between 1 and { len (storage_links )} ." )
110+ click .echo (
111+ f"Invalid choice. Please select a number between 1 and { len (storage_links )} ."
112+ )
104113 return
105114
106- click .echo (f"Selected Storage: { selected_storage_link .name } "
107- f"(ID: { selected_storage_link .id } )" )
115+ click .echo (
116+ f"Selected Storage: { selected_storage_link .name } "
117+ f"(ID: { selected_storage_link .id } )"
118+ )
108119 except Exception as e :
109120 click .echo (f"Error retrieving storage: { e } " )
110121 return
0 commit comments