napari_track_edit.download_progress =================================== .. py:module:: napari_track_edit.download_progress .. autoapi-nested-parse:: A progress dialog for the downloads of the example data. The downloads run on the main thread, so the dialog is kept alive by processing events from the `urlretrieve` report hook. This keeps `example_data` free of Qt, which is also what lets it be used from a script or a notebook. Attributes ---------- .. autoapisummary:: napari_track_edit.download_progress.MB Exceptions ---------- .. autoapisummary:: napari_track_edit.download_progress.DownloadCancelled Functions --------- .. autoapisummary:: napari_track_edit.download_progress.download_progress Module Contents --------------- .. py:data:: MB :value: 1048576 .. py:exception:: DownloadCancelled Bases: :py:obj:`Exception` Raised inside the report hook when the user presses cancel. .. py:function:: download_progress(parent: qtpy.QtWidgets.QWidget, label: str) -> collections.abc.Iterator[collections.abc.Callable[[int, int, int], None]] Show a modal progress dialog, yielding a hook to report download progress. The hook has the signature `urlretrieve` expects, so it can be passed straight to it. Downloads of several files in a row are shown one after the other, because each of them starts counting blocks at zero again. Once a file is in, the bar switches to a busy indicator, since unpacking and converting the data reports no progress but does take a while. :param parent: Widget to center the dialog on :type parent: QWidget :param label: What is being downloaded, shown above the bar :type label: str :Yields: *Callable[[int, int, int], None]* -- `urlretrieve` report hook :raises DownloadCancelled: From the hook, if the user pressed cancel