Changeset fa81e94 in sasview for src/sas/sasgui/perspectives/file_converter
- Timestamp:
- Nov 15, 2017 4:33:09 AM (7 years ago)
- Branches:
- 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
- Children:
- d4881f6a
- Parents:
- 7c487846
- Location:
- src/sas/sasgui/perspectives/file_converter
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/file_converter/__init__.py
- Property mode changed from 100644 to 100755
r77d92cd rfa81e94 1 1 PLUGIN_ID = "File-Converter Plug-In 1.0" 2 from file_converter import *2 from .file_converter import * -
src/sas/sasgui/perspectives/file_converter/converter_panel.py
- Property mode changed from 100644 to 100755
ra26f67f rfa81e94 112 112 [group_path, group_name] = os.path.split(filepath) 113 113 ext = "." + group_name.split('.')[-1] # File extension 114 for frame_number, frame_data in frame_data.ite ritems():114 for frame_number, frame_data in frame_data.items(): 115 115 # Append frame number to base filename 116 116 filename = group_name.replace(ext, str(frame_number)+ext) … … 155 155 # If lines end with comma or semi-colon, trim the last character 156 156 if end_char == ',' or end_char == ';': 157 data = map(lambda s: s[0:-1], data)157 data = [s[0:-1] for s in data] 158 158 else: 159 159 msg = ("Error reading {}: Lines must end with a digit, comma " … … 275 275 else: 276 276 return { 'frames': [], 'inc': None, 'file': single_file } 277 frames = range(first_frame, last_frame + 1, increment)277 frames = list(range(first_frame, last_frame + 1, increment)) 278 278 return { 'frames': frames, 'inc': increment, 'file': single_file } 279 279 … … 335 335 if single_file: 336 336 # Only need to set metadata on first Data1D object 337 frame_data = frame_data.values() # Don't need to know frame numbers337 frame_data = list(frame_data.values()) # Don't need to know frame numbers 338 338 frame_data[0].filename = output_path.split('\\')[-1] 339 for key, value in metadata.ite ritems():339 for key, value in metadata.items(): 340 340 setattr(frame_data[0], key, value) 341 341 else: 342 342 # Need to set metadata for all Data1D objects 343 for datainfo in frame_data.values():343 for datainfo in list(frame_data.values()): 344 344 datainfo.filename = output_path.split('\\')[-1] 345 for key, value in metadata.ite ritems():345 for key, value in metadata.items(): 346 346 setattr(datainfo, key, value) 347 347 … … 355 355 def convert_2d_data(self, dataset): 356 356 metadata = self.get_metadata() 357 for key, value in metadata.ite ritems():357 for key, value in metadata.items(): 358 358 setattr(dataset[0], key, value) 359 359 -
src/sas/sasgui/perspectives/file_converter/converter_widgets.py
- Property mode changed from 100644 to 100755
r0e11ec7 rfa81e94 54 54 v = Vector() 55 55 if not self.Validate(): return v 56 for direction, control in self._inputs.ite ritems():56 for direction, control in self._inputs.items(): 57 57 try: 58 58 value = float(control.GetValue()) … … 86 86 all_valid = True 87 87 invalid_ctrl = None 88 for control in self._inputs.values():88 for control in list(self._inputs.values()): 89 89 if control.GetValue() == '': continue 90 90 control.SetBackgroundColour(wx.WHITE)
Note: See TracChangeset
for help on using the changeset viewer.