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:
Ghostkeeper 2020-02-11 11:02:32 +01:00
parent 5beba6050f
commit bcf4bc8138
No known key found for this signature in database
GPG key ID: 37E2020986774393

View file

@ -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)