From a1cecfa5245ecec8ae1530a979825827296f612f Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Sun, 8 Nov 2020 14:18:37 -0500 Subject: small documentation improvements to demonstrate plugin loading and caveat open_view behavior around bndb loading --- python/__init__.py | 11 ++++++++++- python/plugin.py | 10 ++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/__init__.py b/python/__init__.py index 85a602c4..9c17db48 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -283,7 +283,16 @@ def get_memory_usage_info(): def open_view(*args, **kwargs): """ - Open a BinaryView object + `open_view` opens a BinaryView object. + + Note: If attempting to open a BNDB, the file MUST have the suffix .bndb, or else the file will not be loaded as a database. + + :param str filename: path to filename or bndb to open + :param bool update_analysis: whether or not to run :func:`update_analysis_and_wait` after opening a :py:class:`BinaryView`, defaults to ``True`` + :param callback progress_func: optional function to be called with the current progress and total count + :param dict options: a dictionary in the form {setting identifier string : object value} + :return: returns a :py:class:`BinaryView` object for the given filename or ``None`` + :rtype: :py:class:`BinaryView` or ``None`` :Example: >>> from binaryninja import * diff --git a/python/plugin.py b/python/plugin.py index 3dc5ae7f..326e3c35 100644 --- a/python/plugin.py +++ b/python/plugin.py @@ -540,6 +540,16 @@ class PluginCommand(with_metaclass(_PluginCommandMetaClass, object)): return False def execute(self, context): + r""" + ``execute`` Execute a Plugin + + :param str context: PluginCommandContext to pass the PluginCommamnd + :rtype: None + + >>> ctx = PluginCommandContext(bv); + >>> PluginCommand.get_valid_list(ctx)[r'PDB\Load'].execute(ctx) + + """ if not self.is_valid(context): return if self._command.type == PluginCommandType.DefaultPluginCommand: -- cgit v1.3.1