summaryrefslogtreecommitdiff
path: root/python/pluginmanager.py
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2017-08-31 21:41:25 -0400
committerRusty Wagner <rusty@vector35.com>2017-08-31 21:41:25 -0400
commit7cbb40a71ffb2583862191b7999e436807f9a0e8 (patch)
tree25846f8d0e811b16b28291aeaf6359bee51e28c4 /python/pluginmanager.py
parent980e2f090fb47f7f71a46b03e8c636819f3214ec (diff)
parent0b30396eb319e89e4f69d9cbac12fc3d4b453f53 (diff)
Merge branch 'dev'
Diffstat (limited to 'python/pluginmanager.py')
-rw-r--r--python/pluginmanager.py17
1 files changed, 17 insertions, 0 deletions
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"""
@@ -155,6 +161,11 @@ class Repository(object):
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')"""
return core.BNRepositoryGetLocalReference(self.handle)
@@ -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)