ocesou / hooke

Automatically exported from code.google.com/p/hooke
GNU Lesser General Public License v3.0
0 stars 0 forks source link

crash using wlc without a curve #25

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. launch hooke setting a workdir different from the hooke dir (just to
make him not load the default curve)
2. launch the "wlc" command

What is the expected output? What do you see instead?
I expect somwthing like "No data to fit." .    I get a crash with this error:

hooke: wlc
Traceback (most recent call last):
  File "hooke.py", line 626, in OnGetDisplayedPlot
    self.GetDisplayedPlot(event.dest)
  File "hooke.py", line 634, in GetDisplayedPlot
    displayed_plot=self._plot_of_dest(dest)
  File "hooke.py", line 682, in _plot_of_dest
    for aplot in self.plots:
AttributeError: 'MainWindowPlugged' object has no attribute 'plots'

Original issue reported on code.google.com by fabrizio...@gmail.com on 3 Nov 2009 at 2:54

GoogleCodeExporter commented 8 years ago
Oops. The point is that the default curve is a trick to avoid this kind of 
stuff...
that is, the quickest way to deal with that is to ensure that Hooke always has 
a curve.

But users may not get it :) , so probably some kind of warning is needed.

Original comment by devicera...@gmail.com on 3 Nov 2009 at 3:54

GoogleCodeExporter commented 8 years ago
we have the same behavior with "peaks".   To avoid this problem this control 
should
be enough:

        try:
            have_plot=self.current.curve.default_plots()[0]
        except:
            print "No curve available."
            return None

Should I implement it?

Original comment by fabrizio...@gmail.com on 11 Feb 2010 at 4:25

GoogleCodeExporter commented 8 years ago
Give it a spin :)

Original comment by devicera...@gmail.com on 1 Mar 2010 at 1:53