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

Modified the display during the download: don't clutter several lines… #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

gustavklopp
Copy link

… on the terminal, percentage of the current download display

… on the terminal, percentage of the current download display
@dessant
Copy link
Contributor

dessant commented Jul 25, 2015

Thanks a lot for this. It works with python 2, but it doesn't report the progress as it happens.
The file is dowloaded while Preparing to download http://github.com/kivy-garden/garden.cefpython/archive/master.zip ... is displayed, and after the download, the percentage counter just zips up to 100%.

On python 3, i get this:

Preparing to download http://github.com/kivy-garden/garden.cefpython/archive/master.zip ...
 Traceback (most recent call last):
   File "/home/vix/dev/venvs/py3/bin/garden", line 226, in <module>
     GardenTool().main(sys.argv[1:])
   File "/home/vix/dev/venvs/py3/bin/garden", line 84, in main
     options.func()
   File "/home/vix/dev/venvs/py3/bin/garden", line 140, in cmd_install
     fd = self.download(src_package)
   File "/home/vix/dev/venvs/py3/bin/garden", line 201, in download
     size = int(r.headers['Content-Length'].strip())
   File "/home/vix/dev/venvs/py3/lib/python3.4/site-packages/requests/structures.py", line 54, in __getitem__
     return self._store[key.lower()][1]
 KeyError: 'content-length'

@gustavklopp
Copy link
Author

It zaps to 100% without installing anything? (if you've already downloaded it -or the file is small-, I can't see the progress neither. In fact, the longer is for python-requests to "prepare" the download apparently)

About the error with no Key 'content-length', I've got sometimes the same problem after trying it several times.... Strange. Maybe a connection problem to download this big file? I've put a "try...except"...

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.

2 participants