From 071b0cf8a1076ebe1da70027e58295f27f1970b1 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Fri, 27 Jan 2017 19:57:47 -0500 Subject: add install_pending_update and is_update_installation_pending APIs --- python/update.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'python/update.py') diff --git a/python/update.py b/python/update.py index 7e2bd4ef..6417e4a0 100644 --- a/python/update.py +++ b/python/update.py @@ -238,5 +238,29 @@ def get_time_since_last_update_check(): return core.BNGetTimeSinceLastUpdateCheck() +def is_update_installation_pending(): + """ + ``is_update_installation_pending`` whether an update has been downloaded and is waiting installation + + :return: boolean True if an update is pending, false if no update is pending + :rtype: bool + """ + return core.BNIsUpdateInstallationPending() + + +def install_pending_update(): + """ + ``install_pending_update`` installs any pending updates + + :rtype: None + """ + errors = ctypes.c_char_p() + core.BNInstallPendingUpdate(errors) + if errors: + error_str = errors.value + core.BNFreeString(ctypes.cast(errors, ctypes.POINTER(ctypes.c_byte))) + raise IOError(error_str) + + def updates_checked(): core.BNUpdatesChecked() -- cgit v1.3.1