Changeset 6da3e3d in sasview for src/sas/qtgui/Utilities


Ignore:
Timestamp:
Sep 6, 2018 3:27:00 AM (6 years ago)
Author:
Laura Forster <Awork@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
f84d793, 47471ec
Parents:
0eff615 (diff), 605d944 (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.
Message:

Merge branch 'ESS_GUI' of https://github.com/SasView/sasview into ESS_GUI

Location:
src/sas/qtgui/Utilities
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Utilities/AddMultEditor.py

    raed0532 r287d356  
    1515import re 
    1616import logging 
     17import traceback 
     18 
    1719import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    1820from sasmodels.sasview_model import load_standard_models 
     
    202204                                     self.cbOperator.currentText()) 
    203205 
    204         success = GuiUtils.checkModel(self.plugin_filename) 
     206        try: 
     207            success = GuiUtils.checkModel(self.plugin_filename) 
     208        except Exception as ex: 
     209            # broad exception from sasmodels 
     210            msg = "Error building model: "+ str(ex) 
     211            logging.error(msg) 
     212            #print three last lines of the stack trace 
     213            # this will point out the exact line failing 
     214            last_lines = traceback.format_exc().split('\n')[-4:] 
     215            traceback_to_show = '\n'.join(last_lines) 
     216            logging.error(traceback_to_show) 
     217 
     218            # Set the status bar message 
     219            self.parent.communicate.statusBarUpdateSignal.emit("Model check failed") 
     220            return 
    205221 
    206222        if not success: 
  • src/sas/qtgui/Utilities/GuiUtils.py

    r0eff615 r6da3e3d  
    3535        HELP_DIRECTORY_LOCATION = "docs/sphinx-docs/build/html" 
    3636IMAGES_DIRECTORY_LOCATION = HELP_DIRECTORY_LOCATION + "/_images" 
     37 
     38# This matches the ID of a plot created using FittingLogic._create1DPlot, e.g. 
     39# "5 [P(Q)] modelname" 
     40# or 
     41# "4 modelname". 
     42# Useful for determining whether the plot in question is for an intermediate result, such as P(Q) or S(Q) in the 
     43# case of a product model; the identifier for this is held in square brackets, as in the example above. 
     44theory_plot_ID_pattern = re.compile(r"^([0-9]+)\s+(\[(.*)\]\s+)?(.*)$") 
    3745 
    3846def get_app_dir(): 
     
    211219    # New theory data in current perspective 
    212220    updateTheoryFromPerspectiveSignal = QtCore.pyqtSignal(QtGui.QStandardItem) 
     221 
     222    # Request to delete plots (in the theory view) related to a given model ID 
     223    deleteIntermediateTheoryPlotsSignal = QtCore.pyqtSignal(str) 
    213224 
    214225    # New plot requested from the GUI manager 
  • src/sas/qtgui/Utilities/LocalConfig.py

    re4335ae rb764ae5  
    134134 
    135135# Default threading model 
    136 USING_TWISTED = True 
     136USING_TWISTED = False 
    137137 
    138138# Time out for updating sasview 
  • src/sas/qtgui/Utilities/ReportDialog.py

    rce30949 rcb90b65  
    7373        # Use a sensible filename default 
    7474        default_name = os.path.join(location, 'fit_report.pdf') 
     75 
    7576        kwargs = { 
    7677            'parent'   : self, 
    7778            'caption'  : 'Save Report', 
    78             'directory': default_name, 
     79            # don't use 'directory' in order to remember the previous user choice 
     80            #'directory': default_name, 
    7981            'filter'   : 'PDF file (*.pdf);;HTML file (*.html);;Text file (*.txt)', 
    8082            'options'  : QtWidgets.QFileDialog.DontUseNativeDialog} 
     
    99101 
    100102        # Create files with charts 
    101         pictures = self.getPictures(basename) 
     103        pictures = [] 
     104        if self.data_images is not None: 
     105            pictures = self.getPictures(basename) 
    102106 
    103107        # self.data_html contains all images at the end of the report, in base64 form; 
  • src/sas/qtgui/Utilities/UnitTesting/ReportDialogTest.py

    r144fe21 rcb90b65  
    158158 
    159159        self.assertTrue(logging.error.called) 
    160         logging.error.assert_called_with("Error creating pdf: Failed") 
     160        #logging.error.assert_called_with("Error creating pdf") 
    161161 
Note: See TracChangeset for help on using the changeset viewer.