diff options
| author | Peter LaFosse <peter@vector35.com> | 2017-10-30 22:03:01 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2017-11-06 16:32:07 -0500 |
| commit | b54bf0745bd9ef9809dfce1a8937622f8ed92df5 (patch) | |
| tree | f8b10c81e2242897f0fe765698216542fb0d7f1e /python | |
| parent | 149ee581fe11a806fcd38e8220141007556bc85c (diff) | |
Provide a slightly different implementation for @joshwatson's AnalysisCompletionEvent PR and documentation update
Diffstat (limited to 'python')
| -rw-r--r-- | python/binaryview.py | 13 | ||||
| -rw-r--r-- | python/interaction.py | 2 |
2 files changed, 13 insertions, 2 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()) diff --git a/python/interaction.py b/python/interaction.py index 979549f5..96cac42d 100644 --- a/python/interaction.py +++ b/python/interaction.py @@ -520,7 +520,7 @@ def show_html_report(title, contents, plaintext=""): :param str contents: HTML contents to display :param str plaintext: Plain text version to display (used on the command line) :rtype: None - :Example" + :Example: >>> show_html_report("title", "<h1>Contents</h1>", "Plain text contents") Plain text contents """ |
