|
1 | 1 | import asyncio
|
2 |
| -import os |
3 | 2 | from pathlib import Path
|
4 | 3 |
|
5 | 4 | from dataset_downloader import DatasetDownloader
|
| 5 | +from dir_utils import get_common_directories |
6 | 6 | from nicegui import ui
|
7 | 7 |
|
8 | 8 |
|
@@ -35,16 +35,6 @@ def __init__(self):
|
35 | 35 |
|
36 | 36 | ui.run(host="0.0.0.0", port=8080)
|
37 | 37 |
|
38 |
| - @staticmethod |
39 |
| - def get_common_directories(): |
40 |
| - """Get a list of common directories to choose from.""" |
41 |
| - common_dirs = [ |
42 |
| - str(Path.home()), |
43 |
| - str(Path.home() / "data"), |
44 |
| - str(Path.home() / "workspace"), |
45 |
| - ] |
46 |
| - return [d for d in common_dirs if os.path.exists(d)] |
47 |
| - |
48 | 38 | def update_directory_status(self):
|
49 | 39 | # global status_label, sequence_status_list
|
50 | 40 | """Update the status information for the current directory."""
|
@@ -181,9 +171,7 @@ async def download_ground_truth():
|
181 | 171 | # Directory selection section
|
182 | 172 | ui.label("Select Base Directory").classes("text-h6 q-mb-md text-center")
|
183 | 173 | with ui.row().classes("justify-center"):
|
184 |
| - self.dir_select = ui.select( |
185 |
| - options=self.get_common_directories(), label="Select Directory", with_input=True |
186 |
| - ) |
| 174 | + self.dir_select = ui.select(options=get_common_directories(), label="Select Directory", with_input=True) |
187 | 175 | self.dir_select.props('style="width: 300px"')
|
188 | 176 | self.dir_select.value = str(self.downloader.base_dir)
|
189 | 177 | self.dir_select.on("update:model-value", self.handle_directory_change)
|
|
0 commit comments