Skip to content

Commit f2ae12d

Browse files
committed
fix python plugin install api to default to latest version
1 parent 27f966a commit f2ae12d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

python/pluginmanager.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ def installed(self) -> bool:
9090
return core.BNPluginIsInstalled(self.handle)
9191

9292
def install(self, version_id=None) -> bool:
93-
"""Attempt to install the given plugin"""
93+
"""Attempt to install the given plugin. Defaults to the latest available version."""
9494
self.install_dependencies()
95+
if version_id is None:
96+
version_id = self.current_version.id
9597
return core.BNPluginInstall(self.handle, version_id)
9698

9799
def uninstall(self) -> bool:
@@ -101,8 +103,7 @@ def uninstall(self) -> bool:
101103
@installed.setter
102104
def installed(self, state: bool):
103105
if state:
104-
self.install_dependencies()
105-
core.BNPluginInstall(self.handle, None)
106+
self.install()
106107
else:
107108
core.BNPluginUninstall(self.handle)
108109

0 commit comments

Comments
 (0)