Skip to content

Commit

Permalink
Merge pull request #86 from opengisch/signalname
Browse files Browse the repository at this point in the history
Change signalname because it's triggered when downloaded and model ready
  • Loading branch information
signedav authored Feb 9, 2024
2 parents 60ffbe2 + 7763968 commit 527526d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions modelbaker/iliwrapper/ilicache.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ def drawDisplay(self, painter, option, rect, text):

class IliToppingFileCache(IliDataCache):

download_finished = pyqtSignal()
download_finished_and_model_fresh = pyqtSignal()
"""
meta_netloc is the repository (netloc) of the metaconfiguration file used for file paths in the file_ids
file_ids can contain ilidata: or file: information
Expand Down Expand Up @@ -904,8 +904,9 @@ def on_download_status(self, dataset_id):
# here we could add some more logic
if dataset_id is not None:
self.downloaded_files.append(dataset_id)
# ensure all the files are downloaded and contained in the model
if len(self.downloaded_files) == len(self.file_ids) == self.model.rowCount():
self.download_finished.emit()
self.download_finished_and_model_fresh.emit()

def _process_informationfile(self, file, netloc, url):
"""
Expand Down
4 changes: 3 additions & 1 deletion tests/test_projectgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -4259,7 +4259,9 @@ def get_topping_file_model(self, base_config, id_list, tool_dir=None):

# we wait for the download or we timeout after 30 seconds and we apply what we have
loop = QEventLoop()
topping_file_cache.download_finished.connect(lambda: loop.quit())
topping_file_cache.download_finished_and_model_fresh.connect(
lambda: loop.quit()
)
timer = QTimer()
timer.setSingleShot(True)
timer.timeout.connect(lambda: loop.quit())
Expand Down
4 changes: 3 additions & 1 deletion tests/test_projecttopping.py
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,9 @@ def get_topping_file_model(self, base_config, id_list, tool_dir=None):

# we wait for the download or we timeout after 30 seconds and we apply what we have
loop = QEventLoop()
topping_file_cache.download_finished.connect(lambda: loop.quit())
topping_file_cache.download_finished_and_model_fresh.connect(
lambda: loop.quit()
)
timer = QTimer()
timer.setSingleShot(True)
timer.timeout.connect(lambda: loop.quit())
Expand Down

0 comments on commit 527526d

Please sign in to comment.