Changeset cc2cd5a in sasview for src/sas/sascalc/dataloader/readers
- Timestamp:
- Mar 30, 2019 6:15:53 PM (6 years ago)
- Parents:
- d4cde37 (diff), 0e0c645 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - git-author:
- Jeff Krzywon <krzywon@…> (03/30/19 18:15:53)
- git-committer:
- GitHub <noreply@…> (03/30/19 18:15:53)
- Location:
- src/sas/sascalc/dataloader/readers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/readers/cansas_reader.py
r8c9e65c rcc2cd5a 17 17 # For saving individual sections of data 18 18 from ..data_info import Data1D, Data2D, DataInfo, plottable_1D, plottable_2D, \ 19 Collimation, TransmissionSpectrum, Detector, Process, Aperture, \ 20 combine_data_info_with_plottable as combine_data 19 Collimation, TransmissionSpectrum, Detector, Process, Aperture 21 20 from ..loader_exceptions import FileContentsException, DefaultReaderException, \ 22 21 DataReaderException 23 22 from . import xml_reader 24 23 from .xml_reader import XMLreader 25 from .cansas_constants import CansasConstants , CurrentLevel24 from .cansas_constants import CansasConstants 26 25 27 26 logger = logging.getLogger(__name__) … … 59 58 type = ["XML files (*.xml)|*.xml", "SasView Save Files (*.svs)|*.svs"] 60 59 # List of allowed extensions 61 ext = ['.xml', '. XML', '.svs', '.SVS']60 ext = ['.xml', '.svs'] 62 61 # Flag to bypass extension check 63 62 allow_all = True … … 81 80 self.encoding = None 82 81 83 def read(self, xml_file, schema_path="", invalid=True):82 def _read(self, xml_file, schema_path="", invalid=True): 84 83 if schema_path != "" or not invalid: 85 84 # read has been called from self.get_file_contents because xml file doens't conform to schema … … 90 89 return super(XMLreader, self).read(xml_file) 91 90 92 def get_file_contents(self, xml_file=None, schema_path="", invalid=True): 91 def get_file_contents(self): 92 return self._get_file_contents(xml_file=None, schema_path="", invalid=True) 93 94 def _get_file_contents(self, xml_file=None, schema_path="", invalid=True): 93 95 # Reset everything since we're loading a new file 94 96 self.reset_state() … … 124 126 try: 125 127 # Load data with less strict schema 126 self. read(xml_file, invalid_schema, False)128 self._get_file_contents(xml_file, invalid_schema, False) 127 129 128 130 # File can still be read but doesn't match schema, so raise exception … … 493 495 self.current_datainfo.errors.add(error) 494 496 self.data_cleanup() 495 self.sort_one_d_data() 496 self.sort_two_d_data() 497 self.sort_data() 497 498 self.reset_data_list() 498 499 return self.output[0], None -
src/sas/sascalc/dataloader/readers/associations.py
rc7c8143 r8c9e65c 54 54 exec("loader.associate_file_type('%s', %s)" 55 55 % (ext.upper(), reader)) 56 except :56 except Exception as exc: 57 57 msg = "read_associations: skipping association" 58 msg += " for %s\n %s" % (ext.lower(), sys.exc_value)58 msg += " for %s\n %s" % (ext.lower(), exc) 59 59 logger.error(msg)
Note: See TracChangeset
for help on using the changeset viewer.