mirror of
https://github.com/mandiant/capa.git
synced 2026-01-08 19:31:13 -08:00
pep8
This commit is contained in:
@@ -376,7 +376,7 @@ class CapaExplorerForm(idaapi.PluginForm):
|
||||
"analysis": {
|
||||
# "format" is difficult to determine via IDAPython
|
||||
"extractor": "ida",
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
doc = capa.render.convert_capabilities_to_result_document(meta, rules, capabilities)
|
||||
|
||||
@@ -327,7 +327,7 @@ def collect_metadata(argv, path, format, extractor):
|
||||
sha1 = hashlib.sha1()
|
||||
sha256 = hashlib.sha256()
|
||||
|
||||
with open(path, 'rb') as f:
|
||||
with open(path, "rb") as f:
|
||||
buf = f.read()
|
||||
|
||||
md5.update(buf)
|
||||
@@ -343,10 +343,7 @@ def collect_metadata(argv, path, format, extractor):
|
||||
"sha256": sha256.hexdigest(),
|
||||
"path": os.path.normpath(path),
|
||||
},
|
||||
"analysis": {
|
||||
"format": format,
|
||||
"extractor": extractor.__class__.__name__,
|
||||
},
|
||||
"analysis": {"format": format, "extractor": extractor.__class__.__name__,},
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -258,6 +258,7 @@ def render_default(meta, rules, capabilities):
|
||||
|
||||
class CapaJsonObjectEncoder(json.JSONEncoder):
|
||||
"""JSON encoder that emits Python sets as sorted lists"""
|
||||
|
||||
def default(self, obj):
|
||||
if isinstance(obj, (list, dict, int, float, bool, type(None))) or isinstance(obj, six.string_types):
|
||||
return json.JSONEncoder.default(self, obj)
|
||||
|
||||
Reference in New Issue
Block a user