Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions bundle_tools/drives.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,15 @@ def list_connected_drives(circuitpython_only: bool = True, drive_mount_point: Pa
connected_drives.append(drive_path.parent)
elif os_detect.on_mac():
logger.debug("Platform is Mac OSX!")
logger.info("Hey, if this works, please tell me at "
"https://github.com/UnsignedArduino/CircuitPython-Bundle-Manager/issues!")
logger.info(f"If it doesn't, still tell me please!")
# TODO: Someone test this!
drive_mount_point = Path("/Volumes")
for path in drive_mount_point.glob("*"):
if circuitpython_only and (path / "boot_out.txt").exists():
connected_drives.append(path)
else:
if not circuitpython_only or (path / "boot_out.txt").exists():
connected_drives.append(path)
elif os_detect.on_linux():
logger.debug("Platform is Linux!")
for path in drive_mount_point.glob("*"):
try:
if circuitpython_only and (path / "boot_out.txt").exists():
connected_drives.append(path)
else:
if not circuitpython_only or (path / "boot_out.txt").exists():
connected_drives.append(path)
except PermissionError:
if not circuitpython_only:
Expand Down
12 changes: 8 additions & 4 deletions bundle_tools/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ def list_modules(start_path: Path = None) -> list[str]:
if not lib_directory.exists():
logger.error(f"The lib directory '{lib_directory}' does not exist on the CircuitPython device!")
raise RuntimeError(f"The lib directory '{lib_directory}' does not exist on the CircuitPython device!")
libs = list(lib_directory.glob("*"))
for index, lib in enumerate(libs):
libs[index] = lib.name
libs = [
lib.name
for lib in list(lib_directory.glob("*"))
if lib.name[0] != "." # ignore hidden files
]
logger.debug(f"Modules found: {repr(libs)}")
# sort the modules here, so we have a stable list
libs.sort()
return libs


Expand Down Expand Up @@ -112,5 +116,5 @@ def uninstall_module(module_path: Path = None) -> None:
if module_path.is_file():
module_path.unlink()
else:
rmtree(module_path)
rmtree(module_path, ignore_errors=True)
logger.info(f"Successfully uninstalled {repr(module_path)}!")
1 change: 0 additions & 1 deletion gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ def update_modules_in_device(self) -> None:
except RuntimeError:
logger.exception("Uh oh! Something happened!")
installed_modules = []
installed_modules.sort()
logger.debug(f"Installed modules: {repr(installed_modules)}")
self.installed_modules_listbox_var.set(installed_modules)
except (AttributeError, RuntimeError):
Expand Down