Ran update-copyright.py
[hooke.git] / hooke / plugin / multifit.py
index ee42ea56f3eb9d39148988e41bc5e5d2baaf485f..da857902a7dee81597f6a35cff03db57af9b9bcb 100644 (file)
@@ -1,21 +1,19 @@
-# Copyright (C) 2010 Alberto Gomez-Casado
-#                    W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2010-2012 W. Trevor King <wking@tremily.us>
 #
 # This file is part of Hooke.
 #
-# Hooke is free software: you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation, either
-# version 3 of the License, or (at your option) any later version.
+# Hooke is free software: you can redistribute it and/or modify it under the
+# terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
 #
-# Hooke is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License for more details.
+# Hooke is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
+# details.
 #
-# You should have received a copy of the GNU Lesser General Public
-# License along with Hooke.  If not, see
-# <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public License
+# along with Hooke.  If not, see <http://www.gnu.org/licenses/>.
 
 """The ``multifit`` module provides :class:`MultifitPlugin` and
 several associated :class:`hooke.command.Command`\s for fitting
@@ -24,15 +22,14 @@ all sorts of :class:`hooke.experiment.VelocityClamp` parameters.
 
 from ..command import Command, Argument, Failure
 from ..playlist import FilePlaylist
-from ..plugin import Plugin
-from ..plugin.playlist import PlaylistArgument
+from . import Plugin
+from .playlist import PlaylistArgument
 
 
 class MultifitPlugin (Plugin):
     def __init__(self):
         super(MultifitPlugin, self).__init__(name='multifit')
-        self._commands = [MultifitCommand()]
-        self._setup_commands()
+        self._commands = [MultifitCommand(self)]
 
 
 class MultifitCommand (Command):
@@ -46,7 +43,7 @@ class MultifitCommand (Command):
     """
     #NOTE: centerzero plot modifier should be activated (set centerzero
     #1).
-    def __init__(self):
+    def __init__(self, plugin):
         super(MultifitCommand, self).__init__(
             name='multifit',
             arguments=[
@@ -86,7 +83,7 @@ data between them.
 Perform the fits on the current curve instead of iterating.
 """.strip()),
                 ],
-            help=self.__doc__)
+            help=self.__doc__, plugin=plugin)
 
     def _run(self, hooke, inqueue, outqueue, params):
         counter=0
@@ -123,10 +120,7 @@ Perform the fits on the current curve instead of iterating.
         #remove set leaves some styles disturbing the next graph, fixed by doing do_plot
         self.do_plot(0)
         if contact_point_index>5.0/6.0*sizeret:
-            if params['just one']:
-                break
-            curveindex+=1
-            continue                           
+            return
         
         self.wlccontact_point=contact_point
         self.wlccontact_index=contact_point.index
@@ -297,5 +291,4 @@ Perform the fits on the current curve instead of iterating.
         else:
             print '\nWould you like to try again on this same curve?'
             if self.YNclick():
-                continue
-        curveindex+=1
+                return