output more descriptive output when dependencies fail
This commit is contained in:
parent
843dde1a68
commit
be8e35cbcf
@ -89,12 +89,17 @@ Support and info: https://groups.io/g/openwebrx
|
|||||||
coreConfig = CoreConfig()
|
coreConfig = CoreConfig()
|
||||||
|
|
||||||
featureDetector = FeatureDetector()
|
featureDetector = FeatureDetector()
|
||||||
if not featureDetector.is_available("core"):
|
failed = featureDetector.get_failed_requirements("core")
|
||||||
|
if failed:
|
||||||
logger.error(
|
logger.error(
|
||||||
"you are missing required dependencies to run openwebrx. "
|
"you are missing required dependencies to run openwebrx. "
|
||||||
"please check that the following core requirements are installed and up to date:"
|
"please check that the following core requirements are installed and up to date: %s",
|
||||||
|
", ".join(failed)
|
||||||
)
|
)
|
||||||
logger.error(", ".join(featureDetector.get_requirements("core")))
|
for f in failed:
|
||||||
|
description = featureDetector.get_requirement_description(f)
|
||||||
|
if description:
|
||||||
|
logger.error("description for %s:\n%s", f, description)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Get error messages about unknown / unavailable features as soon as possible
|
# Get error messages about unknown / unavailable features as soon as possible
|
||||||
|
@ -110,6 +110,9 @@ class FeatureDetector(object):
|
|||||||
def is_available(self, feature):
|
def is_available(self, feature):
|
||||||
return self.has_requirements(self.get_requirements(feature))
|
return self.has_requirements(self.get_requirements(feature))
|
||||||
|
|
||||||
|
def get_failed_requirements(self, feature):
|
||||||
|
return [req for req in self.get_requirements(feature) if not self.has_requirement(req)]
|
||||||
|
|
||||||
def get_requirements(self, feature):
|
def get_requirements(self, feature):
|
||||||
try:
|
try:
|
||||||
return FeatureDetector.features[feature]
|
return FeatureDetector.features[feature]
|
||||||
|
Loading…
Reference in New Issue
Block a user