Skip to content

Commit

Permalink
Fix error when Virustotal API key is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
febrezo committed May 28, 2018
1 parent dbe60c8 commit 7185a96
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion neto/lib/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,22 @@ def getThirdparties(self):


def __str__(self):
assesments = ""
if getattr(self, "features", {}).get("thirdparties", []):
for platform in getattr(self, "features").get("thirdparties", []):
try:
assesments += "\n\t- {}: {}".format(
platform,
self.features["thirdparties"][platform]["assesment"]
)
except:
assesments += "\n\t- {}: {}".format(
platform,
"N/F"
)
else:
assesments = "N/A"

return textwrap.dedent("""
Name: {name}
-----
Expand Down Expand Up @@ -610,6 +626,6 @@ def __str__(self):
content_scripts=json.dumps(getattr(self, "manifest", {}).get("content_scripts", []), indent=2),
background=json.dumps(getattr(self, "manifest", {}).get("background", []), indent=2),
entities=json.dumps(getattr(self, "features", {}).get("entities", {}), indent=2),
assesments="\n".join('\t- {}: {}'.format(platform, self.features["thirdparties"][platform]["assesment"]) for platform in getattr(self, "features").get("thirdparties", [])) if getattr(self, "features", {}).get("thirdparties", []) else "N/A",
assesments=assesments,
)
)

0 comments on commit 7185a96

Please sign in to comment.