--- a/src/eric7/MicroPython/Devices/CircuitPythonUpdater/CircupFunctions.py Tue Oct 29 10:59:48 2024 +0100 +++ b/src/eric7/MicroPython/Devices/CircuitPythonUpdater/CircupFunctions.py Tue Oct 29 14:20:50 2024 +0100 @@ -17,6 +17,9 @@ import shutil import circup +import circup.command_utils +import circup.module +import circup.shared import requests from PyQt6.QtCore import QCoreApplication @@ -35,7 +38,7 @@ @type list of circup.Bundle @return list of Module instances describing the current state of the modules on the connected device - @rtype list of circup.Module + @rtype list of circup.module.Module """ backend = ( circup.DiskBackend(device_path, circup.logger) @@ -46,19 +49,25 @@ try: device_modules = backend.get_device_versions() bundle_modules = circup.get_bundle_versions(bundles_list) - for name, device_metadata in device_modules.items(): - if name in bundle_modules: + for key, device_metadata in device_modules.items(): + if key in bundle_modules: path = device_metadata["path"] - bundle_metadata = bundle_modules[name] + bundle_metadata = bundle_modules[key] repo = bundle_metadata.get("__repo__") bundle = bundle_metadata.get("bundle") device_version = device_metadata.get("__version__") bundle_version = bundle_metadata.get("__version__") mpy = device_metadata["mpy"] compatibility = device_metadata.get("compatibility", (None, None)) + module_name = ( + path.split(os.sep)[-1] + if not path.endswith(os.sep) + else path[:-1].split(os.sep)[-1] + os.sep + ) result.append( - circup.Module( - path, + circup.module.Module( + module_name, + backend, repo, device_version, bundle_version, @@ -92,7 +101,7 @@ tag = bundle.latest_tag do_update = False if tag == bundle.current_tag: - for platform in circup.PLATFORMS: + for platform in circup.shared.PLATFORMS: # missing directories (new platform added on an existing install # or side effect of pytest or network errors) do_update = do_update or not os.path.isdir(bundle.lib_dir(platform)) @@ -102,7 +111,7 @@ if do_update: try: circup.get_bundle(bundle, tag) - circup.tags_data_save_tag(bundle.key, tag) + circup.command_utils.tags_data_save_tag(bundle.key, tag) except requests.exceptions.HTTPError as ex: EricMessageBox.critical( None,