updater
Handle updating pyRevit repository and its extensions.
Attributes
logger = get_logger(__name__)
module-attribute
COREUPDATE_TRIGGER = 'COREUPDATE'
module-attribute
COREUPDATE_MESSAGE = '<div class="coreupdatewarn"><strong>IMPORTANT</strong>\npyRevit has a major core update. This update <u>can not</u> be applied when Revit is running. Please close all Revit instances, and update the clone using the pyRevit CLI. Start Revit again after the update and pyRevit will load with the new core changes.</div>'
module-attribute
CHECKUPDATES_TTL_SECONDS = 15 * 60
module-attribute
Functions:
get_thirdparty_ext_repos()
Return a list of repos for installed third-party extensions.
Source code in pyrevitlib/pyrevit/versionmgr/updater.py
get_all_extension_repos()
Return a list of repos for all installed extensions.
Source code in pyrevitlib/pyrevit/versionmgr/updater.py
update_repo(repo_info)
Update repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo_info (
|
obj: |
required |
Source code in pyrevitlib/pyrevit/versionmgr/updater.py
get_updates(repo_info)
Fetch updates on repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo_info (
|
obj: |
required |
Source code in pyrevitlib/pyrevit/versionmgr/updater.py
has_pending_updates(repo_info)
Check for updates on repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo_info (
|
obj: |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
True if the repo's remote is ahead of the local branch head. |
Source code in pyrevitlib/pyrevit/versionmgr/updater.py
check_for_updates()
Check whether any available repo has pending updates.
Fetches every remote on every repo, which the Update smart button's selfinit calls on every session load/reload. Cached in-process for CHECKUPDATES_TTL_SECONDS so rapid reloads (e.g. while developing) don't re-hit the network each time. A no-internet result is never cached, so a transient outage doesn't suppress update detection for the full TTL.
Source code in pyrevitlib/pyrevit/versionmgr/updater.py
has_core_updates()
Check whether pyRevit repo has core updates.
This would require host application to be closed to release the file lock of core DLLs so they can be updated separately.
Source code in pyrevitlib/pyrevit/versionmgr/updater.py
update_pyrevit()
Update pyrevit and its extension repositories.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
True if a reload was triggered (updates were applied), so a caller running from inside a session load (e.g. postload autoupdate) knows the current session was just replaced. |