diff options
author | Anthony LaTorre <tlatorre9@gmail.com> | 2011-08-05 18:28:23 -0400 |
---|---|---|
committer | Anthony LaTorre <tlatorre9@gmail.com> | 2011-08-05 18:28:23 -0400 |
commit | 643f3df7b8538d5c52ea782ec3c22406cadc7c6e (patch) | |
tree | c93b44285888c2500fd0d85d58ca688db2ebe9b7 /detectors/__init__.py | |
parent | 97467c888720451e97dcd0881d90f61641f43b47 (diff) | |
parent | d7f835b3325611ad25209c9a25256b46d4944827 (diff) | |
download | chroma-643f3df7b8538d5c52ea782ec3c22406cadc7c6e.tar.gz chroma-643f3df7b8538d5c52ea782ec3c22406cadc7c6e.tar.bz2 chroma-643f3df7b8538d5c52ea782ec3c22406cadc7c6e.zip |
merge heads
Diffstat (limited to 'detectors/__init__.py')
-rw-r--r-- | detectors/__init__.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/detectors/__init__.py b/detectors/__init__.py index d7583a6..043bdbd 100644 --- a/detectors/__init__.py +++ b/detectors/__init__.py @@ -3,6 +3,7 @@ from sno import build_sno as build_sno_detector import os import sys +import inspect dir = os.path.split(os.path.realpath(__file__))[0] sys.path.append(dir + '/..') @@ -35,3 +36,15 @@ def build_sno(): @buildable('real_sno') def build_real_sno(): return build_sno_detector(real_av=True) + + +def find(detector_name): + members = globals() + buildable_lookup = {} + for member in members.values(): + if inspect.isfunction(member) and \ + hasattr(member, 'buildable') and member.buildable == True: + buildable_lookup[member.identifier] = member + + if detector_name in buildable_lookup: + return buildable_lookup[detector_name]() |