Changeset 5c3d2d3 in sasview


Ignore:
Timestamp:
Jun 20, 2011 9:55:23 AM (13 years ago)
Author:
Jae Cho <jhjcho@…>
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:
eb63b76
Parents:
4520830
Message:

cmd line loading data folder

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/gui_manager.py

    r4520830 r5c3d2d3  
    14131413        else: 
    14141414            path = os.path.abspath(path) 
    1415             if not os.path.isfile(path): 
     1415            if not os.path.isfile(path) and not os.path.isdir(path): 
    14161416               return 
     1417             
     1418            if os.path.isdir(path): 
     1419                self.load_folder(path) 
     1420                return 
     1421 
    14171422        basename  = os.path.basename(path) 
    14181423        root, extension = os.path.splitext(basename) 
     
    14781483            print error_message 
    14791484            
    1480        
     1485    def load_folder(self, path): 
     1486        """ 
     1487        Load entire folder 
     1488        """    
     1489        if not os.path.isdir(path): 
     1490            return 
     1491        if self._data_plugin is None: 
     1492            return 
     1493        try: 
     1494            if path is not None: 
     1495                self._default_save_location = os.path.dirname(path) 
     1496                file_list = self._data_plugin.get_file_path(path) 
     1497                self._data_plugin.get_data(file_list) 
     1498            else: 
     1499                return  
     1500        except: 
     1501            error_message = "Error while loading" 
     1502            error_message += " Data folder from cmd:\n %s\n" % str(path) 
     1503            error_message += str(sys.exc_value) + "\n" 
     1504            print error_message  
     1505             
    14811506    def _on_open_state_application(self, event): 
    14821507        """ 
Note: See TracChangeset for help on using the changeset viewer.