Pep fixes

This commit is contained in:
Philip Ridout 2017-08-04 19:06:43 +01:00
parent 46b42c24e5
commit 1c8474b8e2
3 changed files with 9 additions and 11 deletions

View File

@ -36,10 +36,10 @@ class PQFileDialog(QtWidgets.QFileDialog):
""" """
Reimplement `getExistingDirectory` so that it can be called with, and return Path objects Reimplement `getExistingDirectory` so that it can be called with, and return Path objects
:type parent: QtWidgets.QWidget or None :type parent: QtWidgets.QWidget or None
:type caption: str :type caption: str
:type directory: pathlib.Path :type directory: pathlib.Path
:type options: QtWidgets.QFileDialog.Options :type options: QtWidgets.QFileDialog.Options
:rtype: tuple[Path, str] :rtype: tuple[Path, str]
""" """
@ -57,12 +57,12 @@ class PQFileDialog(QtWidgets.QFileDialog):
""" """
Reimplement `getOpenFileName` so that it can be called with, and return Path objects Reimplement `getOpenFileName` so that it can be called with, and return Path objects
:type parent: QtWidgets.QWidget or None :type parent: QtWidgets.QWidget or None
:type caption: str :type caption: str
:type directory: pathlib.Path :type directory: pathlib.Path
:type filter: str :type filter: str
:type initialFilter: str :type initialFilter: str
:type options: QtWidgets.QFileDialog.Options :type options: QtWidgets.QFileDialog.Options
:rtype: tuple[Path, str] :rtype: tuple[Path, str]
""" """
@ -79,12 +79,12 @@ class PQFileDialog(QtWidgets.QFileDialog):
""" """
Reimplement `getOpenFileNames` so that it can be called with, and return Path objects Reimplement `getOpenFileNames` so that it can be called with, and return Path objects
:type parent: QtWidgets.QWidget or None :type parent: QtWidgets.QWidget or None
:type caption: str :type caption: str
:type directory: pathlib.Path :type directory: pathlib.Path
:type filter: str :type filter: str
:type initialFilter: str :type initialFilter: str
:type options: QtWidgets.QFileDialog.Options :type options: QtWidgets.QFileDialog.Options
:rtype: tuple[list[Path], str] :rtype: tuple[list[Path], str]
""" """
args, kwargs = replace_params(args, kwargs, ((2, 'directory', path_to_str),)) args, kwargs = replace_params(args, kwargs, ((2, 'directory', path_to_str),))
@ -101,12 +101,12 @@ class PQFileDialog(QtWidgets.QFileDialog):
""" """
Reimplement `getSaveFileName` so that it can be called with, and return Path objects Reimplement `getSaveFileName` so that it can be called with, and return Path objects
:type parent: QtWidgets.QWidget or None :type parent: QtWidgets.QWidget or None
:type caption: str :type caption: str
:type directory: pathlib.Path :type directory: pathlib.Path
:type filter: str :type filter: str
:type initialFilter: str :type initialFilter: str
:type options: QtWidgets.QFileDialog.Options :type options: QtWidgets.QFileDialog.Options
:rtype: tuple[Path or None, str] :rtype: tuple[Path or None, str]
""" """
args, kwargs = replace_params(args, kwargs, ((2, 'directory', path_to_str),)) args, kwargs = replace_params(args, kwargs, ((2, 'directory', path_to_str),))

View File

@ -85,4 +85,4 @@ class TestPath(TestCase):
result = str_to_path('') result = str_to_path('')
# THEN: `path_to_str` should return None # THEN: `path_to_str` should return None
self.assertEqual(result, None) self.assertEqual(result, None)

View File

@ -18,8 +18,6 @@ class TestFileDialogPatches(TestCase):
""" """
Test that the :class:`PQFileDialog` instantiates correctly Test that the :class:`PQFileDialog` instantiates correctly
""" """
#app = QtWidgets.QApplication(sys.argv)
# GIVEN: The PQFileDialog class # GIVEN: The PQFileDialog class
# WHEN: Creating an instance # WHEN: Creating an instance
instance = PQFileDialog() instance = PQFileDialog()