summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2008-07-01 00:46:07 +0200
committerHans Ulrich Niedermann <hun@n-dimensional.de>2008-07-15 12:28:55 +0200
commit741c14b644a3c2a134163d2372e97ec70c3ae9bc (patch)
tree45059202ab420c6524017c6a5a5dc1f99a3bdaf1
parentd3571ab23839adb57216378539425fb3c42c0bc2 (diff)
downloadnbb-741c14b644a3c2a134163d2372e97ec70c3ae9bc.tar.gz
nbb-741c14b644a3c2a134163d2372e97ec70c3ae9bc.tar.xz
nbb-741c14b644a3c2a134163d2372e97ec70c3ae9bc.zip
Document detect() plugin methods
-rw-r--r--src/nbblib/bs.py8
-rw-r--r--src/nbblib/plugins.py4
-rw-r--r--src/nbblib/vcs.py8
3 files changed, 19 insertions, 1 deletions
diff --git a/src/nbblib/bs.py b/src/nbblib/bs.py
index 5b7b19b..43c3f44 100644
--- a/src/nbblib/bs.py
+++ b/src/nbblib/bs.py
@@ -45,6 +45,14 @@ class BSSourceTree(plugins.GenericDetectPlugin):
repr(obj.tree_root), repr(vcs_tree.tree_root))
return obj.tree_root == vcs_tree.tree_root
+ @classmethod
+ def detect(cls, context, vcs_tree):
+ """Examine vcs_tree for build system has and return BSSourceTree obj
+
+ @param vcs_tree the vcs.VCSourceTree object to examine
+ """
+ super(BSSourceTree, cls).detect(context, vcs_tree)
+
def get_tree_root(self): return self._get_tree_root()
tree_root = property(get_tree_root)
diff --git a/src/nbblib/plugins.py b/src/nbblib/plugins.py
index c42420d..8131426 100644
--- a/src/nbblib/plugins.py
+++ b/src/nbblib/plugins.py
@@ -56,7 +56,9 @@ class MyPluginB(MyPluginType):
raise self.no_match_exception()
Ideas:
- * Get rid of references to "context", and handle that in derived classes.
+ * Get rid of references to 'context', and handle that in derived classes.
+ Bad idea, as any serious plugin using program will have the plugins
+ operating in some kind of context.
"""
diff --git a/src/nbblib/vcs.py b/src/nbblib/vcs.py
index 6162f3c..ed7d73e 100644
--- a/src/nbblib/vcs.py
+++ b/src/nbblib/vcs.py
@@ -82,6 +82,14 @@ class VCSourceTree(plugins.GenericDetectPlugin):
logging.debug("srcdir %s", srcdir)
return obj.tree_root == srcdir
+ @classmethod
+ def detect(cls, context, srcdir):
+ """Examine srcdir for VCS system and return proper VCSourceTree obj
+
+ @param srcdir string with absolute path of source code directory
+ """
+ super(VCSourceTree, cls).detect(context, srcdir)
+
def get_config(self):
"""Get configuration object which determines builddir etc"""
return AbstractConfig(self.tree_root, self.branch_name)