From f1635877f0fd4dcb7972dd8400fd74e0bcad94d8 Mon Sep 17 00:00:00 2001 From: Johnny Sequeira Date: Fri, 1 Nov 2024 09:06:02 -0600 Subject: [PATCH] Adding typing hints --- qfieldsync/gui/package_dialog.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qfieldsync/gui/package_dialog.py b/qfieldsync/gui/package_dialog.py index 3abd0f0e..54ce9f73 100644 --- a/qfieldsync/gui/package_dialog.py +++ b/qfieldsync/gui/package_dialog.py @@ -136,7 +136,7 @@ def setup_gui(self): else: self.show_package_page() - def get_export_folder(self): + def get_export_folder(self) -> str: """Get the export folder according to the inputs in the selected""" export_dirname = self.qfield_preferences.value("exportDirectoryProject") if not export_dirname: @@ -146,14 +146,14 @@ def get_export_folder(self): ) return QDir.toNativeSeparators(str(export_dirname)) - def get_export_filename_suggestion(self): + def get_export_filename_suggestion(self) -> str: export_folder = Path(self.get_export_folder()) full_project_name_suggestion = export_folder.joinpath( f"{self.project.baseName()}_qfield.qgs" ) return str(full_project_name_suggestion) - def set_export_filename_suggested(self): + def set_export_filename_suggested(self) -> None: self.packagedProjectFileWidget.setFilePath( self.get_export_filename_suggestion() ) @@ -163,13 +163,13 @@ def show_package_page(self): self.button_box.setVisible(True) self.stackedWidget.setCurrentWidget(self.packagePage) - def run_package_project(self): + def run_package_project(self) -> None: export_packaged_project = Path(self.packagedProjectFileWidget.filePath()) if export_packaged_project.suffix != ".qgs": QMessageBox.critical( self, - self.tr("Invalid File"), + self.tr("Invalid Filename"), self.tr('The filename must have a ".qgs" extension.'), ) return