CellProfiler / CellProfiler-Analyst

Open-source software for exploring and analyzing large, high-dimensional image-derived data.
http://cellprofileranalyst.org
Other
144 stars 73 forks source link

More helpful dialog if properties file loaded with bad chars in filters #15

Open braymp opened 12 years ago

braymp commented 12 years ago

Right now, cpa quits suddenly with the following error msg (unseen if not using cli)


Traceback (most recent call last): File "cpa.py", line 529, in app = CPAnalyst(redirect=False) File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx_core.py", line 7981, in init self._BootstrapApp() File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx_core.py", line 7555, in _BootstrapApp return core.PyApp__BootstrapApp(_args, *_kwargs) File "cpa.py", line 447, in OnInit if not show_load_dialog(): File "c:\Trunk\CellProfiler-Analyst\cpa\guiutils.py", line 814, in show_load_dialog p.load_file(filename) File "c:\Trunk\CellProfiler-Analyst\cpa\properties.py", line 248, in load_file

raise Exception, 'PROPERTIES ERROR (%s): Filter names may only contain alphanumeric characters and "_".'%filter_name) Exception: PROPERTIES ERROR (092110-NR1): Filter names may only contain alphanumeric characters and "".


A pleasant dialog box would be nice.

thouis commented 12 years ago

There are two bugs here: first, we should do something other than throw an exception when loading properties, if at all possible. In this case, probably we should offer to rename the filter. Since CPA can't run without a good properties file, we should make an effort to be accommodating to somewhat broken ones.

Also, we should use the CP error dialog on uncaught exceptions in CPA.