Changeset ec489f5 in sasview for guiframe/local_perspectives
- Timestamp:
- Feb 2, 2011 7:18:18 PM (14 years ago)
- 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:
- 13913ec
- Parents:
- 6886000
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/local_perspectives/data_loader/data_loader.py
r52725d6 rec489f5 65 65 if not file_list or file_list[0] is None: 66 66 return 67 self.get_ data(file_list, flag=flag)67 self.get_state(file_list) 68 68 69 69 def load_folder(self, event): … … 165 165 file) for file in os.listdir(path)] 166 166 167 def get_state(self, path, format=None): 168 """ 169 read state 170 """ 171 output = [] 172 for p_file in path: 173 basename = os.path.basename(p_file) 174 root, extension = os.path.splitext(basename) 175 for extension in EXTENSIONS: 176 temp = self.loader.load(p_file, extension) 177 if temp.__class__.__name__ == "list": 178 for item in temp: 179 data = self.create_data(item, p_file) 180 else: 181 data = self.create_data(temp, p_file) 182 output.append(data) 183 self.load_complete(output=output, path=path) 184 167 185 def get_data(self, path, format=None, flag=True): 168 186 """ … … 190 208 continue 191 209 try: 192 temp = self.loader.load(p_file )210 temp = self.loader.load(p_file, format) 193 211 if temp.__class__.__name__ == "list": 194 212 print "list", temp … … 197 215 output.append(data) 198 216 else: 199 print " list", temp217 print "not list", [temp] 200 218 data = self.create_data(temp, p_file) 201 219 output.append(data) … … 214 232 215 233 216 def old_get_data(self, path, format=None, flag=True):217 """218 :param flag: is True load only data file, else load state file219 Receive a list of file paths and return a list of Data objects220 """221 from .load_thread import DataReader222 message = "Start Loading \n"223 wx.PostEvent(self.parent, StatusEvent(status=message,224 info="info", type="progress"))225 calc_load = DataReader(loader=self.loader,226 path=path,227 flag=flag,228 transform_data=self.create_data,229 updatefn=self.load_update,230 completefn=self.load_complete)231 calc_load.queue()232 233 234 def load_update(self, output=None, message=""): 234 235 """
Note: See TracChangeset
for help on using the changeset viewer.