Minor imperovements

This commit is contained in:
Ivan Kravets
2020-08-26 14:51:53 +03:00
parent 3c91e3c1e1
commit 8625fdc571
3 changed files with 345 additions and 222 deletions

View File

@ -139,14 +139,13 @@ class PackageManageRegistryMixin(object):
def fetch_registry_package(self, spec):
assert isinstance(spec, PackageSpec)
result = None
regclient = self.get_registry_client_instance()
if spec.owner and spec.name:
result = self.get_registry_client_instance().get_package(
self.pkg_type, spec.owner, spec.name
)
result = regclient.get_package(self.pkg_type, spec.owner, spec.name)
if not result and (spec.id or (spec.name and not spec.owner)):
packages = self.search_registry_packages(spec)
if packages:
result = self.get_registry_client_instance().get_package(
result = regclient.get_package(
self.pkg_type, packages[0]["owner"]["username"], packages[0]["name"]
)
if not result:

View File

@ -114,7 +114,7 @@ class PlatformBase( # pylint: disable=too-many-instance-attributes,too-many-pub
core_spec = semantic_version.SimpleSpec(self.engines["platformio"])
if self.CORE_SEMVER in core_spec:
return True
# PIO Core 4 is compatible with dev-platforms for PIO Core 2.0, 3.0, 4.0
# PIO Core 5 is compatible with dev-platforms for PIO Core 2.0, 3.0, 4.0
if any(semantic_version.Version.coerce(str(v)) in core_spec for v in (2, 3, 4)):
return True
raise IncompatiblePlatform(self.name, str(self.CORE_SEMVER), str(core_spec))

File diff suppressed because it is too large Load Diff