Use hooke.command_by_name[...] in hooke.plugin.*.
authorW. Trevor King <wking@drexel.edu>
Thu, 11 Nov 2010 13:15:54 +0000 (08:15 -0500)
committerW. Trevor King <wking@drexel.edu>
Thu, 11 Nov 2010 13:15:54 +0000 (08:15 -0500)
hooke/plugin/convfilt.py
hooke/plugin/flatfilt.py
hooke/plugin/polymer_fit.py

index a741f69938ae223f06454546050c46aec1eef3b9..59c2f57bae0d03af8ddbba5c42f37226ce33de22 100644 (file)
@@ -200,8 +200,7 @@ class ConvolutionFilterCommand (FilterCommand):
         params['curve'] = curve
         inq = Queue()
         outq = Queue()
-        conv_command = [c for c in self.hooke.commands
-                        if c.name=='convolution peaks'][0]
+        conv_command = self.hooke.command_by_name['convolution peaks']
         conv_command.run(hooke, inq, outq, **params)
         peaks = outq.get()
         if isinstance(peaks, UncaughtException) \
index 44f0e1f8ed3f5e1806e66cf4592a3516de924a3d..27caf158dba9d3ff165b8f161ccf7fb37202256b 100644 (file)
@@ -222,8 +222,7 @@ class FlatFilterCommand (FilterCommand):
         params['curve'] = curve
         inq = Queue()
         outq = Queue()
-        filt_command = [c for c in hooke.commands
-                        if c.name=='flat filter peaks'][0]
+        filt_command = hooke.command_by_name['flat filter peaks']
         filt_command.run(hooke, inq, outq, **params)
         peaks = outq.get()
         if isinstance(peaks, UncaughtException) \
index 9d1a86b6d50de845701d03064c64ac37bb36bbf8..7105e570841a1fca6c3c073778c71e03fb46436c 100644 (file)
@@ -1089,8 +1089,7 @@ Index of the selected peak in the list of peaks.  Use `None` to fit all peaks.
 
     def _run(self, hooke, inqueue, outqueue, params):
         data = self._block(hooke, params)
-        fit_command = [c for c in hooke.commands
-                       if c.name=='polymer fit'][0]
+        fit_command = hooke.command_by_name['polymer fit']
         inq = Queue()
         outq = Queue()
         curve = params['curve']