From 326253abc74f7d6b601e03463df6abe8b8929428 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Thu, 10 Aug 2017 15:30:42 -0400 Subject: Fixes to allow plugins to be installed and loaded from headless --- python/pluginmanager.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'python/pluginmanager.py') diff --git a/python/pluginmanager.py b/python/pluginmanager.py index c0f70260..6896d699 100644 --- a/python/pluginmanager.py +++ b/python/pluginmanager.py @@ -144,6 +144,12 @@ class Repository(object): def __repr__(self): return "<{} - {}/{}>".format(self.path, self.remote_reference, self.local_reference) + def __getitem__(self, plugin_path): + for plugin in self.plugins: + if plugin_path == plugin.path: + return plugin + raise KeyError() + @property def url(self): """String url of the git repository where the plugin repository's are stored""" @@ -154,6 +160,11 @@ class Repository(object): """String local path to store the given plugin repository""" return core.BNRepositoryGetRepoPath(self.handle) + @property + def full_path(self): + """String full path the repository""" + return core.BNRepositoryGetPluginsPath(self.handle) + @property def local_reference(self): """String for the local git reference (ie 'master')""" @@ -190,6 +201,12 @@ class RepositoryManager(object): def __init__(self, handle=None): self.handle = core.BNGetRepositoryManager() + def __getitem__(self, repo_path): + for repo in self.repositories: + if repo_path == repo.path: + return repo + raise KeyError() + def check_for_updates(self): """Check for updates for all managed Repository objects""" return core.BNRepositoryManagerCheckForUpdates(self.handle) -- cgit v1.3.1