diff --git a/installers/sasview.spec b/installers/sasview.spec index 2d528e3b31..294c508b97 100644 --- a/installers/sasview.spec +++ b/installers/sasview.spec @@ -24,6 +24,7 @@ datas = [ datas.append((os.path.join(PYTHON_PACKAGES, 'debugpy'), 'debugpy')) datas.append((os.path.join(PYTHON_PACKAGES, 'jedi'), 'jedi')) datas.append((os.path.join(PYTHON_PACKAGES, 'zmq'), 'zmq')) +datas.append((os.path.join(PYTHON_PACKAGES, 'freetype'), 'freetype')) def add_data(data): for component in data: diff --git a/src/sas/qtgui/Calculators/SlitSizeCalculator.py b/src/sas/qtgui/Calculators/SlitSizeCalculator.py index 65b3a3da4f..c42f6dc6e7 100644 --- a/src/sas/qtgui/Calculators/SlitSizeCalculator.py +++ b/src/sas/qtgui/Calculators/SlitSizeCalculator.py @@ -116,7 +116,7 @@ def calculateSlitSize(self, data=None): try: xdata = data.x ydata = data.y - if xdata.size == 0 or xdata is None or ydata.size == 0 or ydata is None: + if xdata is None or len(xdata) == 0 or ydata is None or len(ydata) == 0: msg = "The current data is empty please check x and y" logging.error(msg) return diff --git a/src/sas/qtgui/Plotting/Plotter.py b/src/sas/qtgui/Plotting/Plotter.py index dc18d9b915..12266ab6ae 100644 --- a/src/sas/qtgui/Plotting/Plotter.py +++ b/src/sas/qtgui/Plotting/Plotter.py @@ -394,7 +394,7 @@ def addPlotsToContextMenu(self): if plot.is_data: self.actionHideError = plot_menu.addAction("Hide Error Bar") - if plot.dy is not None and plot.dy != []: + if plot.dy is not None and len(plot.dy)>0: if plot.hide_error: self.actionHideError.setText('Show Error Bar') else: diff --git a/src/sas/qtgui/Plotting/UnitTesting/PlotterBaseTest.py b/src/sas/qtgui/Plotting/UnitTesting/PlotterBaseTest.py index e6e7df305b..fde48eb739 100644 --- a/src/sas/qtgui/Plotting/UnitTesting/PlotterBaseTest.py +++ b/src/sas/qtgui/Plotting/UnitTesting/PlotterBaseTest.py @@ -49,7 +49,7 @@ def testDefaults(self, plotter): assert isinstance(plotter.canvas, FigureCanvas) assert isinstance(plotter.properties, ScaleProperties) - assert plotter._data == [] + assert len(plotter._data) == 0 assert plotter._xscale == 'log' assert plotter._yscale == 'log' assert plotter.scale == 'linear' diff --git a/src/sas/qtgui/Utilities/Reports/ReportDialog.py b/src/sas/qtgui/Utilities/Reports/ReportDialog.py index 4c15d2fd0b..696950cc0c 100644 --- a/src/sas/qtgui/Utilities/Reports/ReportDialog.py +++ b/src/sas/qtgui/Utilities/Reports/ReportDialog.py @@ -64,7 +64,7 @@ def onPrint(self): try: # pylint chokes on this line with syntax-error # pylint: disable=syntax-error doesn't seem to help - document.print(printer) + document.print_(printer) except Exception as ex: # Printing can return various exceptions, let's catch them all logging.error("Print report failed with: " + str(ex)) diff --git a/src/sas/qtgui/Utilities/UnitTesting/ReportDialogTest.py b/src/sas/qtgui/Utilities/UnitTesting/ReportDialogTest.py index 46ccc67c06..1f11b58df8 100644 --- a/src/sas/qtgui/Utilities/UnitTesting/ReportDialogTest.py +++ b/src/sas/qtgui/Utilities/UnitTesting/ReportDialogTest.py @@ -51,7 +51,7 @@ def testDefaults(self, widget): def testOnPrint(self, widget, mocker): ''' Printing the report ''' document = widget.txtBrowser.document() - mocker.patch.object(document, 'print') + mocker.patch.object(document, 'print_') # test rejected dialog mocker.patch.object(QtPrintSupport.QPrintDialog, 'exec_', return_value=QtWidgets.QDialog.Rejected) @@ -60,7 +60,7 @@ def testOnPrint(self, widget, mocker): widget.onPrint() # Assure printing was not done - assert not document.print.called + assert not document.print_.called # test accepted dialog mocker.patch.object(QtPrintSupport.QPrintDialog, 'exec_', return_value=QtWidgets.QDialog.Accepted)