summaryrefslogtreecommitdiff
path: root/python/binaryview.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2017-10-30 22:03:01 -0400
committerPeter LaFosse <peter@vector35.com>2017-10-30 22:03:06 -0400
commitde70f093cc429a125dde201cfe245b616c10ebce (patch)
treef8b10c81e2242897f0fe765698216542fb0d7f1e /python/binaryview.py
parenta774e47ee36a5d4418c9aec13e5612f158a825d3 (diff)
Provide a slightly different implementation for @joshwatson's AnalysisCompletionEvent PR and documentation update
Diffstat (limited to 'python/binaryview.py')
-rw-r--r--python/binaryview.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index 9304d412..e6cb5b04 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -103,6 +103,17 @@ class StringReference(object):
class AnalysisCompletionEvent(object):
+ """
+ The ``AnalysisCompletionEvent`` object provides an asynchronous mechanism for receiving
+ callbacks when analysis is complete.
+
+ :Example:
+ >>> def on_complete(self):
+ ... print "Analysis Complete", self.view
+ ...
+ >>> evt = AnalysisCompletionEvent(bv, on_complete)
+ >>>
+ """
def __init__(self, view, callback):
self.view = view
self.callback = callback
@@ -114,7 +125,7 @@ class AnalysisCompletionEvent(object):
def _notify(self, ctxt):
try:
- self.callback()
+ self.callback(self)
except:
log.log_error(traceback.format_exc())