If readJSON fails, it puts an entry in the log and then returns None. This then crashes with a TypeError because you can't check for things to be in None.
Fixes Sentry issue CURA-3V5.
Was using Qt5 still, even though we're dumping that. Need a bit of a level playing field for an update to the way we handle libArcus and libSavitar.
part of CURA-7924
Long API calls might return after the Local or Remote
PackageList has been deconstructed. Somehow setting
the ownership in QML doesn't seem to work for this.
So we guard against this with a try catch block.
Contributes to: CURA-8587
The server is queried using the local packages_id and version to
determine if they can be updated. The Manage button state is set
accordingly. This is done in an async way to keep the UI responsive
A.t.m I'm not sure if I might need to move this logic out, since
we also need to make this query when check periodically for updates.
when the list is not shown. But that would also entail creating
the installed packages list before the Manage Packages tab is ever
created in the Marketplace.
Contributes to: CURA-8587
The speed increase on the function when running Yappi
`LocalPackageList.updatePackages`
| original | now |
|----------|------|
| 14 ms | 4 ms |
Contributes to CURA-8558
@ghostkeeper being nerd snipped
It's giving that typing failure because the section variable is re-used.
First as elements from self._getSections (strs) and then as elements
from sorted_sections.values() (List[PackageModel]s). Python has no
variable scopes within functions so the variable still exists after the
first for loop.
Contributes to CURA-8558
The previous implementation added a section_title to the package_info
which was also stored in the packages.json. The section_title is now
provided to the PackageModel as an extra optional argument.
Contributes to CURA-8558
A user might still need to interact with a **to be installed** package.
But the current package list doesn't list that package anymore.
Introduced a `getPackagesToInstall()` method in the Uranium PackageManager
to circumvent this issue.
Contributes to CURA-8558
A user might still need to interact with a **to be removed** package and
it is also still being used in the current Cura session. But the current
package list doesn't list that package anymore.
Introduced a `getPackagesToRemove()` method in the Uranium PackageManager
to circumvent this issue.
Contributes to CURA-8558
The order in which UX defined the different sections are:
- Installed Cura Plugins
- Installed Materials
- Bundled Plugins
- Bundled Materials
All packages need to be order at least by section, but I also took
the liberty to sort the packages in these sections by Alphabet.
Contributes to CURA-8558
By providing a `section_title` with a string to the `package_data`
packages can be subdivided in sections, each with its own header.
For remote packages this will be `None` and therefore no sections are
created there.
Contributes to CURA-8558