mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Simplify _is_any_version_compatible
It now literally says: for any version, is it compatible? Contributes to issue CURA-7207.
This commit is contained in:
parent
5beba6050f
commit
bcf4bc8138
1 changed files with 6 additions and 5 deletions
|
@ -74,8 +74,9 @@ class SubscribedPackagesModel(ListModel):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _is_any_version_compatible(package_manager: PackageManager, api_versions: [str]) -> bool:
|
def _is_any_version_compatible(package_manager: PackageManager, api_versions: [str]) -> bool:
|
||||||
""":return: True when any of the provided api versions is compatible"""
|
"""
|
||||||
for version in api_versions:
|
Check a list of version numbers if any of them applies to our
|
||||||
if package_manager.isPackageCompatible(Version(version)):
|
application.
|
||||||
return True
|
:return: ``True`` when any of the provided API versions is compatible.
|
||||||
return False
|
"""
|
||||||
|
return any(package_manager.isPackageCompatible(Version(version)) for version in api_versions)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue