This commit is contained in:
Paulus Schoutsen 2019-07-31 12:25:30 -07:00
parent da05dfe708
commit 4de97abc3a
2676 changed files with 163166 additions and 140084 deletions

View file

@ -44,14 +44,16 @@ class Integration:
assert path.is_dir()
integrations = {}
for fil in path.iterdir():
if fil.is_file() or fil.name == '__pycache__':
if fil.is_file() or fil.name == "__pycache__":
continue
init = fil / '__init__.py'
init = fil / "__init__.py"
if not init.exists():
print("Warning: {} missing, skipping directory. "
"If this is your development environment, "
"you can safely delete this folder.".format(init))
print(
"Warning: {} missing, skipping directory. "
"If this is your development environment, "
"you can safely delete this folder.".format(init)
)
continue
integration = cls(fil)
@ -75,21 +77,15 @@ class Integration:
def load_manifest(self) -> None:
"""Load manifest."""
manifest_path = self.path / 'manifest.json'
manifest_path = self.path / "manifest.json"
if not manifest_path.is_file():
self.add_error(
'model',
"Manifest file {} not found".format(manifest_path)
)
self.add_error("model", "Manifest file {} not found".format(manifest_path))
return
try:
manifest = json.loads(manifest_path.read_text())
except ValueError as err:
self.add_error(
'model',
"Manifest contains invalid JSON: {}".format(err)
)
self.add_error("model", "Manifest contains invalid JSON: {}".format(err))
return
self.manifest = manifest