-
Notifications
You must be signed in to change notification settings - Fork 20
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
Show progress bar when uploading image #15
Conversation
bar = '#' * filled_len + '-' * (length - filled_len) | ||
raw_elapsed = time.time() - start_time | ||
elapsed = time.strftime("[%H:%M:%S]", time.gmtime(raw_elapsed)) | ||
sys.stdout.write(f'\r |{bar}| {cur}/{total} {percent}% {elapsed}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refactor to remove F-strings. We need to maintain older Python compat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review. it's been fixed.
tests/test_definitions.py
Outdated
import requests | ||
|
||
import pytest | ||
import requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need requests twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed unused import pytest too.
tests/test_definitions.py
Outdated
from virl2_client.models import NodeImageDefinitions | ||
|
||
def test_upload_image_files(requests_mock): | ||
adapter = requests_mock.post('mock://images/upload') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format your code with black.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests/test_definitions.py has been formatted by black.
Thanks for the contribution, @exjobo , I'll merge this soon. Just need to figure out how to ideally integrate this into our dev branch. Should be no big deal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, except for the cosmetic stuff... will merge.
bar = '#' * filled_len + '-' * (length - filled_len) | ||
raw_elapsed = time.time() - start_time | ||
elapsed = time.strftime("[%H:%M:%S]", time.gmtime(raw_elapsed)) | ||
sys.stdout.write('\r |{}| {}/{} {}% {}'.format(bar, cur, total, percent, elapsed)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be print
, really. You can do the same thing with print("something", end="", flush=True)
.
there's also a couple of single quotes for strings instead of double quotes and trailing whitespace. Ideally, pip install black
and run black over the code base to get consistent formatting.
this is no big deal, though... I'm going to merge this. we will incorporate this change into our dev branch and make the additional changes there so that they can be included into the 2.3 release.
…de-tags-are-overwritten-when-adding-new-tags-via-pcl to dev * commit '2128d14b8f299e9612e0b11cf3d849bb58791810': SIMPLE-3713 - Fix client node tag addition
* show progress bar when uploading image * fixup! show progress bar when uploading image * fixup! show progress bar when uploading image Co-authored-by: Yoshitaka Nagami <ynagami@cisco.com> release 2.3.0 (#19) 2.4.0 release cherry pick changes from bb/dev - changed some documentation (use of CML vs VIRL) in the README.md - added a CHANGES.md - updated dependencies - removed "deprecation" warning in lab.is_active() - reverted the pytest configuration changes so that GH actions will pass - pre-commit black version constraint bumped to 22.3 see https://stackoverflow.com/questions/71673404/importerror-cannot-import-name-unicodefun-from-click - run GH actions also on the dev branch - removed "asyncio_mode = auto" from pytest.ini (we're not depending on pytest-asyncio) - updated requirements.txt for venv installation via GitHub Actions sphinx and pytest config changes format long lines addressing comments
…l-from-github-repo-and-improve-deprecation-warnings to dev * commit '331422e2e783c4fc801ec0ae46da74673d91b3f5': Show progress bar when uploading image (#15)
* show progress bar when uploading image * fixup! show progress bar when uploading image * fixup! show progress bar when uploading image Co-authored-by: Yoshitaka Nagami <ynagami@cisco.com> minor changes - added .vscode to .gitignore - Makefile updates - replace sys.stdout.write with print - dependency update bumped version to 2.21.post2 updated requirements.txt
…_with_gh to master * commit '4dee82c2587e2df09db08fa8fb80899b7daccf22': Show progress bar when uploading image (#15)
Enhancement For #14