Skip to content

Commit

Permalink
Adding typing hints
Browse files Browse the repository at this point in the history
  • Loading branch information
SeqLaz committed Nov 1, 2024
1 parent f60f4d7 commit f163587
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions qfieldsync/gui/package_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()
)
Expand All @@ -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
Expand Down

0 comments on commit f163587

Please sign in to comment.