diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2017-01-27 19:57:47 -0500 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2017-01-27 19:57:47 -0500 |
| commit | 071b0cf8a1076ebe1da70027e58295f27f1970b1 (patch) | |
| tree | 0e8d81b850eb3d4b21c9805c46475c7b0172a00f /python/update.py | |
| parent | b6636ec672069142919a9e735660d07213b93623 (diff) | |
add install_pending_update and is_update_installation_pending APIs
Diffstat (limited to 'python/update.py')
| -rw-r--r-- | python/update.py | 24 |
1 files changed, 24 insertions, 0 deletions
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() |
