Changeset 0cd8612 in sasview for src/sas/qtgui/DataExplorer.py


Ignore:
Timestamp:
Jul 8, 2016 10:13:41 AM (8 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
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:
a95260d
Parents:
e540cd2
Message:

output console + logging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/DataExplorer.py

    re540cd2 r0cd8612  
    1313 
    1414# SAS 
    15 from GuiUtils import * 
     15import GuiUtils 
    1616from Plotter import Plotter 
    1717from sas.sascalc.dataloader.loader import Loader 
     
    307307        """ 
    308308 
    309         plots = plotsFromCheckedItems(self.model) 
     309        plots = GuiUtils.plotsFromCheckedItems(self.model) 
    310310 
    311311        # Call show on requested plots 
     
    334334            paths = [str(f) for f in paths] 
    335335 
    336         if type(paths) is not list: 
     336        if not isinstance(paths, list): 
    337337            paths = [paths] 
    338338 
     
    358358            basename = os.path.basename(p_file) 
    359359            _, extension = os.path.splitext(basename) 
    360             if extension.lower() in EXTENSIONS: 
     360            if extension.lower() in GuiUtils.EXTENSIONS: 
    361361                any_error = True 
    362362                log_msg = "Data Loader cannot " 
     
    430430 
    431431        if any_error or error_message: 
    432             self.communicator.statusBarUpdateSignal.emit(error_message) 
     432            logging.error(error_message) 
     433            status_bar_message = "Errors occurred while loading %s" % format(basename) 
     434            self.communicator.statusBarUpdateSignal.emit(status_bar_message) 
    433435 
    434436        else: 
    435437            message = "Loading Data Complete! " 
    436438        message += log_msg 
     439        # Notify the progress bar that the updates are over. 
    437440        self.communicator.progressBarUpdateSignal.emit(-1) 
    438441 
     
    485488 
    486489                try: 
    487                     is1D = type(item.child(0).data().toPyObject()) is Data1D 
     490                    is1D = isinstance(item.child(0).data().toPyObject(), Data1D) 
    488491                except AttributeError: 
    489492                    msg = "Bad structure of the data model." 
     
    499502 
    500503                try: 
    501                     is1D = type(item.child(0).data().toPyObject()) is Data1D 
     504                    is1D = isinstance(item.child(0).data().toPyObject(), Data1D) 
    502505                except AttributeError: 
    503506                    msg = "Bad structure of the data model." 
     
    513516                item.setCheckState(QtCore.Qt.Unchecked) 
    514517                try: 
    515                     is2D = type(item.child(0).data().toPyObject()) is Data2D 
     518                    is2D = isinstance(item.child(0).data().toPyObject(), Data2D) 
    516519                except AttributeError: 
    517520                    msg = "Bad structure of the data model." 
     
    527530 
    528531                try: 
    529                     is2D = type(item.child(0).data().toPyObject()) is Data2D 
     532                    is2D = isinstance(item.child(0).data().toPyObject(), Data2D) 
    530533                except AttributeError: 
    531534                    msg = "Bad structure of the data model." 
     
    602605 
    603606        # Add rows for display in the view 
    604         info_item = infoFromData(data) 
     607        info_item = GuiUtils.infoFromData(data) 
    605608 
    606609        # Set info_item as the only child 
     
    616619        """ 
    617620        # Assert the correct type 
    618         if type(model_item) != QtGui.QStandardItem: 
     621        if not isinstance(model_item, QtGui.QStandardItem): 
    619622            msg = "Wrong data type returned from calculations." 
    620623            raise AttributeError, msg 
Note: See TracChangeset for help on using the changeset viewer.