Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add progress bar to app_utils.download_file() #391

Open
wants to merge 3 commits into
base: naomi-dev
Choose a base branch
from

Conversation

aaronchantrill
Copy link
Contributor

Description

Add a progress bar to app_utils.download_file(url, local_filename) function. This is only really useful when using the command line client (we don't have another client right now) and only before the microphone feedback starts to display. It would be nice to move this into a visualization someday, but this is pretty tightly integrated with the operation itself.

This commit also gives the download_file function the ability to resume partial downloads.

Related Issue

Standard functions with progress bars for downloads #303

Motivation and Context

If a large file needs to be downloaded, this gives the user a sense of how long the download will take.

How Has This Been Tested?

I have tested this function on a laptop computer and a Raspberry Pi 4 both running Debian Bookworm. I tested by installing the https://github.com/aaronchantrill/Naomi_VOSK_STT plugin and allowing it to download a model.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Add a progress bar to app_utils.download_file(url, local_filename)
function. This is only really useful when using the command line
client (we don't have another client right now) and only before
the microphone feedback starts to display. It would be nice to
move this into a visualization someday, but this is pretty tightly
integrated with the operation itself.

This commit also gives the download_file function the ability to
resume partial downloads.
naomi/app_utils.py Fixed Show fixed Hide fixed
naomi/app_utils.py appears to have been saved in dos eol format.
This just updates the format to unix eol format for linux users.
Windows users should have their line endings converted automatically
when they clone the repository. Leaving the lines in dos eol
format makes changes show up with ^M characters at the end when
doing git diff. This commit is only changing the line endings in
this one file.
Fixed a possibly uninitialized variable in naomi/app_utils.py.
Also fixed a couple of flake8 complaints about inline comments
without two spaces between the code and the hash symbol.

Fixed an error that was causing the unittests to fail in
diagnose.py.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant