Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fit report save fix #2684

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions installers/sasview.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/sas/qtgui/Utilities/Reports/ReportDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions src/sas/qtgui/Utilities/UnitTesting/ReportDialogTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down