Ignore:
Timestamp:
May 19, 2012 10:17:02 AM (12 years ago)
Author:
Mathieu Doucet <doucetm@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
baa915c
Parents:
d225e32
Message:

Merge 2.1.1 into trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansguiframe/src/sans/guiframe/gui_manager.py

    r6306f2f r940aca7  
    452452            return 
    453453        _, ext = os.path.splitext(name) 
    454         fd = open(file_name, 'w') 
     454        try: 
     455            fd = open(file_name, 'w') 
     456        except: 
     457            # On Permission denied: IOError 
     458            temp_dir = get_user_directory() 
     459            temp_file_name = os.path.join(temp_dir, name) 
     460            fd = open(temp_file_name, 'w') 
    455461        separator = "\t" 
    456462        if ext.lower() == ".csv": 
     
    491497            excel_app.Visible = 1 
    492498        except: 
    493             msg = "Error occured when calling Excel\n" 
    494             msg += "Check that Excel in installed in this machine or \n" 
    495             msg += "Check that %s really exists.\n" % str(file_name) 
     499            msg = "Error occured when calling Excel.\n" 
     500            msg += "Check that Excel installed in this machine or \n" 
     501            msg += "check that %s really exists.\n" % str(file_name) 
    496502            wx.PostEvent(self, StatusEvent(status=msg, 
    497503                                             info="error")) 
     
    10311037        return menu_list 
    10321038         
    1033          
     1039    def get_current_context_menu(self, plotpanel=None): 
     1040        """ 
     1041        Get the context menu items made available  
     1042        by the current plug-in.  
     1043        This function is used by the plotting module 
     1044        """ 
     1045        if plotpanel is None: 
     1046            return 
     1047        menu_list = [] 
     1048        item = self._current_perspective 
     1049        if item != None: 
     1050            menu_list.extend(item.get_context_menu(plotpanel=plotpanel)) 
     1051        return menu_list 
     1052             
    10341053    def on_panel_close(self, event): 
    10351054        """ 
     
    25982617                if has_errors: 
    25992618                    if data.dx != [] and data.dx[i] != None: 
    2600                         out.write("%g  %g  %g  %g\n" % (data.x[i],  
    2601                                                     data.y[i], 
    2602                                                     data.dy[i], 
    2603                                                     data.dx[i])) 
     2619                        if  data.dx[i] != None: 
     2620                            out.write("%g  %g  %g  %g\n" % (data.x[i],  
     2621                                                        data.y[i], 
     2622                                                        data.dy[i], 
     2623                                                        data.dx[i])) 
     2624                        else: 
     2625                            out.write("%g  %g  %g\n" % (data.x[i],  
     2626                                                        data.y[i], 
     2627                                                        data.dy[i])) 
    26042628                    else: 
    26052629                        out.write("%g  %g  %g\n" % (data.x[i],  
Note: See TracChangeset for help on using the changeset viewer.