Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/common/Util/InstrumentDB.py
diff options
context:
space:
mode:
authoramartin <olpc@xo-05-28-21.localdomain>2007-11-03 05:39:53 (GMT)
committer amartin <olpc@xo-05-28-21.localdomain>2007-11-03 05:39:53 (GMT)
commitf6b47121238d699066b110399e6b1619773752bf (patch)
treef1f07c196c17596d30c91837c384293df03eeec5 /common/Util/InstrumentDB.py
parent1c2c38e8a8136a004ea2f302753d61f83d443196 (diff)
instruments saved by name
Diffstat (limited to 'common/Util/InstrumentDB.py')
-rw-r--r--common/Util/InstrumentDB.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/Util/InstrumentDB.py b/common/Util/InstrumentDB.py
index 82c0e56..d11fed8 100644
--- a/common/Util/InstrumentDB.py
+++ b/common/Util/InstrumentDB.py
@@ -100,6 +100,13 @@ class InstrumentDB:
def getInstrument( self, id ):
return self.inst[id]
+ def getInstrumentByName( self, name ):
+ try:
+ return self.instNamed[ name ]
+ except:
+ print "Instrument not found: ", name
+ return self.inst[0]
+
def debug_summarize(self):
for i in self.inst:
print i.id, i.name