Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
improve docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed Aug 27, 2019
1 parent 74eeb1f commit d39986d
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions IsogeoToOffice.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def settings_loader(self):
def search(self, search_type: str = "update"):
"""Get filters and make search.
:param str search_type: can be update, reset or export
:param str search_type: can be update, reset or export. Defaults to 'update'.
"""
# configure thread search
self.ui.pgb_exports.setRange(0, 0)
Expand Down Expand Up @@ -459,8 +459,10 @@ def search(self, search_type: str = "update"):
prog_step=0, status_msg=self.tr("Waiting for Isogeo API")
)

def get_selected_filters(self):
def get_selected_filters(self) -> tuple:
"""Retrieve selected filters from the search form.
:rtype: tuple
"""
share_id = ""
search_terms = ""
Expand All @@ -473,7 +475,7 @@ def get_selected_filters(self):
return share_id, search_terms.strip()

# -- EXPORT ---------------------------------------------------------------
def export_check(self):
def export_check(self) -> bool:
"""Performs checks before export."""
# check export options
self.li_opts = [
Expand All @@ -495,11 +497,11 @@ def export_check(self):
)
return True

@pyqtSlot(dict)
def export_process(self, search_to_be_exported: dict):
@pyqtSlot(MetadataSearch)
def export_process(self, search_to_be_exported: MetadataSearch):
"""Export each metadata in checked output formats.
:param dict search_to_be_exported: Isogeo search response to export
:param MetadataSearch search_to_be_exported: Isogeo search response to export
"""
# minimize application during process if asked. See #22
if self.ui.chb_systray_minimize.isChecked():
Expand Down Expand Up @@ -605,11 +607,11 @@ def export_process(self, search_to_be_exported: dict):
else:
pass

@pyqtSlot(dict)
def thumbnails_generation(self, search_to_be_exported: dict):
@pyqtSlot(MetadataSearch)
def thumbnails_generation(self, search_to_be_exported: MetadataSearch):
"""Process thumbnails table generation.
:param dict search_to_be_exported: Isogeo search response to export
:param MetadataSearch search_to_be_exported: Isogeo search response to export
"""
# prepare progress bar
progbar_max = sum(self.li_opts) * search_to_be_exported.total
Expand Down Expand Up @@ -771,6 +773,7 @@ def processing(self, step: str = "start", progbar_max: int = 0):
widgets...
:param str step: step of processing (start, end or progress)
:param int progbar_max: maximum range for the progress bar.
"""
if step == "start":
logger.debug("Start processing. Freezing search form.")
Expand Down Expand Up @@ -845,6 +848,9 @@ def fill_app_props(
self, app_infos_retrieved: str = "", latest_online_version: str = ""
):
"""Get app properties and fillfull the share frame in settings tab.
:param str app_infos_retrieved: application information to display into the settings tabs
:param str latest_online_version: latest version retrieved from GitHub to compare with the actual
"""
# fill settings tab text
self.ui.txt_shares.setText(app_infos_retrieved)
Expand Down Expand Up @@ -883,6 +889,8 @@ def update_credentials(self):
@pyqtSlot(MetadataSearch)
def update_search_form(self, search: MetadataSearch):
"""Update search form with tags.
:param MetadataSearch search: search returned with tags as dicts to update the search form.
"""
# check if search returned some results
if not search.total:
Expand Down Expand Up @@ -971,7 +979,10 @@ def update_search_form(self, search: MetadataSearch):

@pyqtSlot(int, str)
def update_status_bar(self, prog_step: int = 1, status_msg: str = ""):
"""Display message into status bar
"""Display message into status bar.
:param int prog_step: step to increase the progress bar. Defaults to 1.
:param str status_msg: message to display into the status bar
"""
# status bar and systray
self.ui.lbl_statusbar.showMessage(status_msg)
Expand Down

0 comments on commit d39986d

Please sign in to comment.