summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/__init__.py33
-rw-r--r--python/examples/version_switcher.py6
2 files changed, 33 insertions, 6 deletions
diff --git a/python/__init__.py b/python/__init__.py
index 9ee8f158..d155c331 100644
--- a/python/__init__.py
+++ b/python/__init__.py
@@ -230,21 +230,48 @@ def _init_plugins():
_destruct_callbacks = _DestructionCallbackHandler()
def bundled_plugin_path():
+ """
+ ``bundled_plugin_path`` returns a string containing the current plugin path inside the `install path <https://docs.binary.ninja/getting-started.html#binary-path>`_
+
+ :return: current bundled plugin path
+ :rtype: str, or None on failure
+ """
return core.BNGetBundledPluginDirectory()
def user_plugin_path():
+ """
+ ``user_plugin_path`` returns a string containing the current plugin path inside the `user directory <https://docs.binary.ninja/getting-started.html#user-folder>`_
+
+ :return: current user plugin path
+ :rtype: str, or None on failure
+ """
return core.BNGetUserPluginDirectory()
def core_version():
- '''Core version'''
+ """
+ ``core_version`` returns a string containing the current version
+
+ :return: current version
+ :rtype: str, or None on failure
+ """
return core.BNGetVersionString()
def core_build_id():
- '''Build ID'''
+ """
+ ``core_build_id`` returns a string containing the current build id
+
+ :return: current build id
+ :rtype: str, or None on failure
+ """
core.BNGetBuildId()
def core_serial():
- '''Serial Number'''
+ """
+ ``core_serial`` returns a string containing the current serial number
+
+ :return: current serial
+ :rtype: str, or None on failure
+ """
return core.BNGetSerialNumber()
def core_expires():
diff --git a/python/examples/version_switcher.py b/python/examples/version_switcher.py
index cf99df5b..0270e121 100644
--- a/python/examples/version_switcher.py
+++ b/python/examples/version_switcher.py
@@ -72,11 +72,11 @@ def select(version):
if are_auto_updates_enabled():
print("Disabling automatic updates.")
set_auto_updates_enabled(False)
- if (version.version == core_version):
+ if (version.version == core_version()):
print("Already running %s" % version.version)
else:
print("version.version %s" % version.version)
- print("core_version %s" % core_version)
+ print("core_version %s" % core_version())
print("Downloading...")
print(version.update())
print("Installing...")
@@ -121,7 +121,7 @@ def main():
while not done:
print("\n\tBinary Ninja Version Switcher")
print("\t\tCurrent Channel:\t%s" % channel.name)
- print("\t\tCurrent Version:\t%s" % core_version)
+ print("\t\tCurrent Version:\t%s" % core_version())
print("\t\tAuto-Updates On:\t%s\n" % are_auto_updates_enabled())
for index, version in enumerate(versions):
date = datetime.datetime.fromtimestamp(version.time).strftime('%c')