mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 22:39:02 +08: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
@ -74,8 +74,9 @@ class SubscribedPackagesModel(ListModel):
|
||||
|
||||
@staticmethod
|
||||
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:
|
||||
if package_manager.isPackageCompatible(Version(version)):
|
||||
return True
|
||||
return False
|
||||
"""
|
||||
Check a list of version numbers if any of them applies to our
|
||||
application.
|
||||
:return: ``True`` when any of the provided API versions is compatible.
|
||||
"""
|
||||
return any(package_manager.isPackageCompatible(Version(version)) for version in api_versions)
|
||||
|
Loading…
x
Reference in New Issue
Block a user